Unnamed: 0
int64
0
56k
source_code
stringlengths
55
5.98k
comments
stringlengths
2
1.76k
label
stringclasses
68 values
dataset_name
stringclasses
1 value
file_name
stringlengths
208
265
function
stringlengths
27
87
decompiled_code
stringlengths
68
3.97k
compiler_options
stringclasses
1 value
6,800
void CWE665_Improper_Initialization__wchar_t_ncat_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109930/CWE665_Improper_Initialization__wchar_t_ncat_61a.c
CWE665_Improper_Initialization__wchar_t_ncat_61_good
void CWE665_Improper_Initialization__wchar_t_ncat_61_good(void) { goodG2B(); return; }
['gcc']
6,801
wchar_t * CWE665_Improper_Initialization__wchar_t_ncat_61b_badSource(wchar_t * data) { /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ return data; }
['/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109930/CWE665_Improper_Initialization__wchar_t_ncat_61b.c
CWE665_Improper_Initialization__wchar_t_ncat_61b_badSource
undefined8 CWE665_Improper_Initialization__wchar_t_ncat_61b_badSource(undefined8 param_1) { return param_1; }
['gcc']
6,802
wchar_t * CWE665_Improper_Initialization__wchar_t_ncat_61b_goodG2BSource(wchar_t * data) { /* FIX: Properly initialize data */ data[0] = L'\0'; /* null terminate */ return data; }
['/* FIX: Properly initialize data */', '/* null terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109930/CWE665_Improper_Initialization__wchar_t_ncat_61b.c
CWE665_Improper_Initialization__wchar_t_ncat_61b_goodG2BSource
undefined4 * CWE665_Improper_Initialization__wchar_t_ncat_61b_goodG2BSource(undefined4 *param_1) { *param_1 = 0; return param_1; }
['gcc']
6,803
void CWE665_Improper_Initialization__wchar_t_ncat_63_bad() { wchar_t * data; wchar_t dataBuffer[100]; data = dataBuffer; /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ CWE665_Improper_Initialization__wchar_t_ncat_63b_badSink(&data); }
['/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109932/CWE665_Improper_Initialization__wchar_t_ncat_63a.c
CWE665_Improper_Initialization__wchar_t_ncat_63_bad
void CWE665_Improper_Initialization__wchar_t_ncat_63_bad(void) { undefined auStack_1a8 [408]; undefined *puStack_10; puStack_10 = auStack_1a8; CWE665_Improper_Initialization__wchar_t_ncat_63b_badSink(&puStack_10); return; }
['gcc']
6,804
void CWE665_Improper_Initialization__wchar_t_ncat_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109932/CWE665_Improper_Initialization__wchar_t_ncat_63a.c
CWE665_Improper_Initialization__wchar_t_ncat_63_good
void CWE665_Improper_Initialization__wchar_t_ncat_63_good(void) { goodG2B(); return; }
['gcc']
6,805
void CWE665_Improper_Initialization__wchar_t_ncat_63b_badSink(wchar_t * * dataPtr) { wchar_t * data = *dataPtr; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109932/CWE665_Improper_Initialization__wchar_t_ncat_63b.c
CWE665_Improper_Initialization__wchar_t_ncat_63b_badSink
void CWE665_Improper_Initialization__wchar_t_ncat_63b_badSink(undefined8 *param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = *param_1; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,806
void CWE665_Improper_Initialization__wchar_t_ncat_63b_goodG2BSink(wchar_t * * dataPtr) { wchar_t * data = *dataPtr; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109932/CWE665_Improper_Initialization__wchar_t_ncat_63b.c
CWE665_Improper_Initialization__wchar_t_ncat_63b_goodG2BSink
void CWE665_Improper_Initialization__wchar_t_ncat_63b_goodG2BSink(undefined8 *param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = *param_1; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,807
void CWE665_Improper_Initialization__wchar_t_ncat_64_bad() { wchar_t * data; wchar_t dataBuffer[100]; data = dataBuffer; /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ CWE665_Improper_Initialization__wchar_t_ncat_64b_badSink(&data); }
['/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109933/CWE665_Improper_Initialization__wchar_t_ncat_64a.c
CWE665_Improper_Initialization__wchar_t_ncat_64_bad
void CWE665_Improper_Initialization__wchar_t_ncat_64_bad(void) { undefined auStack_1a8 [408]; undefined *puStack_10; puStack_10 = auStack_1a8; CWE665_Improper_Initialization__wchar_t_ncat_64b_badSink(&puStack_10); return; }
['gcc']
6,808
void CWE665_Improper_Initialization__wchar_t_ncat_64_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109933/CWE665_Improper_Initialization__wchar_t_ncat_64a.c
CWE665_Improper_Initialization__wchar_t_ncat_64_good
void CWE665_Improper_Initialization__wchar_t_ncat_64_good(void) { goodG2B(); return; }
['gcc']
6,809
void CWE665_Improper_Initialization__wchar_t_ncat_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr; /* dereference dataPtr into data */ wchar_t * data = (*dataPtr); { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', "/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109933/CWE665_Improper_Initialization__wchar_t_ncat_64b.c
CWE665_Improper_Initialization__wchar_t_ncat_64b_badSink
void CWE665_Improper_Initialization__wchar_t_ncat_64b_badSink(undefined8 *param_1) { undefined auStack_1b8 [396]; undefined4 uStack_2c; undefined8 uStack_20; undefined8 uStack_18; undefined8 *puStack_10; uStack_18 = *param_1; puStack_10 = param_1; func_0x00400ab0(auStack_1b8,0x43,99); uStack_2c = 0; uStack_20 = func_0x00400aa0(auStack_1b8); func_0x00400a70(uStack_18,auStack_1b8,uStack_20); printWLine(uStack_18); return; }
['gcc']
6,810
void CWE665_Improper_Initialization__wchar_t_ncat_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr; /* dereference dataPtr into data */ wchar_t * data = (*dataPtr); { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', "/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109933/CWE665_Improper_Initialization__wchar_t_ncat_64b.c
CWE665_Improper_Initialization__wchar_t_ncat_64b_goodG2BSink
void CWE665_Improper_Initialization__wchar_t_ncat_64b_goodG2BSink(undefined8 *param_1) { undefined auStack_1b8 [396]; undefined4 uStack_2c; undefined8 uStack_20; undefined8 uStack_18; undefined8 *puStack_10; uStack_18 = *param_1; puStack_10 = param_1; func_0x00400ab0(auStack_1b8,0x43,99); uStack_2c = 0; uStack_20 = func_0x00400aa0(auStack_1b8); func_0x00400a70(uStack_18,auStack_1b8,uStack_20); printWLine(uStack_18); return; }
['gcc']
6,811
void CWE665_Improper_Initialization__wchar_t_ncat_65_bad() { wchar_t * data; /* define a function pointer */ void (*funcPtr) (wchar_t *) = CWE665_Improper_Initialization__wchar_t_ncat_65b_badSink; wchar_t dataBuffer[100]; data = dataBuffer; /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */', '/* use the function pointer */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109934/CWE665_Improper_Initialization__wchar_t_ncat_65a.c
CWE665_Improper_Initialization__wchar_t_ncat_65_bad
void CWE665_Improper_Initialization__wchar_t_ncat_65_bad(void) { undefined auStack_1a8 [400]; undefined *puStack_18; code *pcStack_10; pcStack_10 = CWE665_Improper_Initialization__wchar_t_ncat_65b_badSink; puStack_18 = auStack_1a8; CWE665_Improper_Initialization__wchar_t_ncat_65b_badSink(puStack_18); return; }
['gcc']
6,812
void CWE665_Improper_Initialization__wchar_t_ncat_65_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109934/CWE665_Improper_Initialization__wchar_t_ncat_65a.c
CWE665_Improper_Initialization__wchar_t_ncat_65_good
void CWE665_Improper_Initialization__wchar_t_ncat_65_good(void) { goodG2B(); return; }
['gcc']
6,813
void CWE665_Improper_Initialization__wchar_t_ncat_65b_badSink(wchar_t * data) { { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109934/CWE665_Improper_Initialization__wchar_t_ncat_65b.c
CWE665_Improper_Initialization__wchar_t_ncat_65b_badSink
void CWE665_Improper_Initialization__wchar_t_ncat_65b_badSink(undefined8 param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_10; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_10 = func_0x00400aa0(auStack_1a8); func_0x00400a70(param_1,auStack_1a8,uStack_10); printWLine(param_1); return; }
['gcc']
6,814
void CWE665_Improper_Initialization__wchar_t_ncat_65b_goodG2BSink(wchar_t * data) { { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109934/CWE665_Improper_Initialization__wchar_t_ncat_65b.c
CWE665_Improper_Initialization__wchar_t_ncat_65b_goodG2BSink
void CWE665_Improper_Initialization__wchar_t_ncat_65b_goodG2BSink(undefined8 param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_10; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_10 = func_0x00400aa0(auStack_1a8); func_0x00400a70(param_1,auStack_1a8,uStack_10); printWLine(param_1); return; }
['gcc']
6,815
void CWE665_Improper_Initialization__wchar_t_ncat_66_bad() { wchar_t * data; wchar_t * dataArray[5]; wchar_t dataBuffer[100]; data = dataBuffer; /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ /* put data in array */ dataArray[2] = data; CWE665_Improper_Initialization__wchar_t_ncat_66b_badSink(dataArray); }
['/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */', '/* put data in array */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109935/CWE665_Improper_Initialization__wchar_t_ncat_66a.c
CWE665_Improper_Initialization__wchar_t_ncat_66_bad
void CWE665_Improper_Initialization__wchar_t_ncat_66_bad(void) { undefined auStack_1c8 [400]; undefined auStack_38 [16]; undefined *puStack_28; undefined *puStack_10; puStack_28 = auStack_1c8; puStack_10 = puStack_28; CWE665_Improper_Initialization__wchar_t_ncat_66b_badSink(auStack_38); return; }
['gcc']
6,816
void CWE665_Improper_Initialization__wchar_t_ncat_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109935/CWE665_Improper_Initialization__wchar_t_ncat_66a.c
CWE665_Improper_Initialization__wchar_t_ncat_66_good
void CWE665_Improper_Initialization__wchar_t_ncat_66_good(void) { goodG2B(); return; }
['gcc']
6,817
void CWE665_Improper_Initialization__wchar_t_ncat_66b_badSink(wchar_t * dataArray[]) { /* copy data out of dataArray */ wchar_t * data = dataArray[2]; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
['/* copy data out of dataArray */', "/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109935/CWE665_Improper_Initialization__wchar_t_ncat_66b.c
CWE665_Improper_Initialization__wchar_t_ncat_66b_badSink
void CWE665_Improper_Initialization__wchar_t_ncat_66b_badSink(long param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = *(undefined8 *)(param_1 + 0x10); func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,818
void CWE665_Improper_Initialization__wchar_t_ncat_66b_goodG2BSink(wchar_t * dataArray[]) { wchar_t * data = dataArray[2]; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109935/CWE665_Improper_Initialization__wchar_t_ncat_66b.c
CWE665_Improper_Initialization__wchar_t_ncat_66b_goodG2BSink
void CWE665_Improper_Initialization__wchar_t_ncat_66b_goodG2BSink(long param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = *(undefined8 *)(param_1 + 0x10); func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,819
void CWE665_Improper_Initialization__wchar_t_ncat_67_bad() { wchar_t * data; CWE665_Improper_Initialization__wchar_t_ncat_67_structType myStruct; wchar_t dataBuffer[100]; data = dataBuffer; /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ myStruct.structFirst = data; CWE665_Improper_Initialization__wchar_t_ncat_67b_badSink(myStruct); }
['/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109936/CWE665_Improper_Initialization__wchar_t_ncat_67a.c
CWE665_Improper_Initialization__wchar_t_ncat_67_bad
void CWE665_Improper_Initialization__wchar_t_ncat_67_bad(void) { undefined auStack_1a8 [400]; undefined *puStack_18; undefined *puStack_10; puStack_18 = auStack_1a8; puStack_10 = puStack_18; CWE665_Improper_Initialization__wchar_t_ncat_67b_badSink(puStack_18); return; }
['gcc']
6,820
void CWE665_Improper_Initialization__wchar_t_ncat_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109936/CWE665_Improper_Initialization__wchar_t_ncat_67a.c
CWE665_Improper_Initialization__wchar_t_ncat_67_good
void CWE665_Improper_Initialization__wchar_t_ncat_67_good(void) { goodG2B(); return; }
['gcc']
6,821
void CWE665_Improper_Initialization__wchar_t_ncat_67b_badSink(CWE665_Improper_Initialization__wchar_t_ncat_67_structType myStruct) { wchar_t * data = myStruct.structFirst; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109936/CWE665_Improper_Initialization__wchar_t_ncat_67b.c
CWE665_Improper_Initialization__wchar_t_ncat_67b_badSink
void CWE665_Improper_Initialization__wchar_t_ncat_67b_badSink(undefined8 param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = param_1; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,822
void CWE665_Improper_Initialization__wchar_t_ncat_67b_goodG2BSink(CWE665_Improper_Initialization__wchar_t_ncat_67_structType myStruct) { wchar_t * data = myStruct.structFirst; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109936/CWE665_Improper_Initialization__wchar_t_ncat_67b.c
CWE665_Improper_Initialization__wchar_t_ncat_67b_goodG2BSink
void CWE665_Improper_Initialization__wchar_t_ncat_67b_goodG2BSink(undefined8 param_1) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = param_1; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,823
void CWE665_Improper_Initialization__wchar_t_ncat_68_bad() { wchar_t * data; wchar_t dataBuffer[100]; data = dataBuffer; /* FLAW: Do not initialize data */ ; /* empty statement needed for some flow variants */ CWE665_Improper_Initialization__wchar_t_ncat_68_badData = data; CWE665_Improper_Initialization__wchar_t_ncat_68b_badSink(); }
['/* FLAW: Do not initialize data */', '/* empty statement needed for some flow variants */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109937/CWE665_Improper_Initialization__wchar_t_ncat_68a.c
CWE665_Improper_Initialization__wchar_t_ncat_68_bad
void CWE665_Improper_Initialization__wchar_t_ncat_68_bad(void) { undefined auStack_1a8 [408]; undefined *puStack_10; CWE665_Improper_Initialization__wchar_t_ncat_68_badData = auStack_1a8; puStack_10 = CWE665_Improper_Initialization__wchar_t_ncat_68_badData; CWE665_Improper_Initialization__wchar_t_ncat_68b_badSink(); return; }
['gcc']
6,824
void CWE665_Improper_Initialization__wchar_t_ncat_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109937/CWE665_Improper_Initialization__wchar_t_ncat_68a.c
CWE665_Improper_Initialization__wchar_t_ncat_68_good
void CWE665_Improper_Initialization__wchar_t_ncat_68_good(void) { goodG2B(); return; }
['gcc']
6,825
void CWE665_Improper_Initialization__wchar_t_ncat_68b_badSink() { wchar_t * data = CWE665_Improper_Initialization__wchar_t_ncat_68_badData; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
['CWE665']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109937/CWE665_Improper_Initialization__wchar_t_ncat_68b.c
CWE665_Improper_Initialization__wchar_t_ncat_68b_badSink
void CWE665_Improper_Initialization__wchar_t_ncat_68b_badSink(void) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = CWE665_Improper_Initialization__wchar_t_ncat_68_badData; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,826
void CWE665_Improper_Initialization__wchar_t_ncat_68b_goodG2BSink() { wchar_t * data = CWE665_Improper_Initialization__wchar_t_ncat_68_goodG2BData; { size_t sourceLen; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ sourceLen = wcslen(source); /* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */ wcsncat(data, source, sourceLen); printWLine(data); } }
["/* fill with L'C's */", '/* null terminate */', '/* POTENTIAL FLAW: If data is not initialized properly, wcsncat() may not function correctly */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109937/CWE665_Improper_Initialization__wchar_t_ncat_68b.c
CWE665_Improper_Initialization__wchar_t_ncat_68b_goodG2BSink
void CWE665_Improper_Initialization__wchar_t_ncat_68b_goodG2BSink(void) { undefined auStack_1a8 [396]; undefined4 uStack_1c; undefined8 uStack_18; undefined8 uStack_10; uStack_10 = CWE665_Improper_Initialization__wchar_t_ncat_68_goodG2BData; func_0x00400ab0(auStack_1a8,0x43,99); uStack_1c = 0; uStack_18 = func_0x00400aa0(auStack_1a8); func_0x00400a70(uStack_10,auStack_1a8,uStack_18); printWLine(uStack_10); return; }
['gcc']
6,827
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01_bad() { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109945/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,828
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109945/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_01_good(void) { good1(); return; }
['gcc']
6,829
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02_bad() { if(1) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109946/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,830
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109946/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_02_good(void) { good1(); good2(); return; }
['gcc']
6,831
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03_bad() { if(5==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109947/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,832
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109947/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_03_good(void) { good1(); good2(); return; }
['gcc']
6,833
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04_bad() { if(STATIC_CONST_TRUE) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109948/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,834
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109948/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_04_good(void) { good1(); good2(); return; }
['gcc']
6,835
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05_bad() { if(staticTrue) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109949/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (staticTrue != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,836
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109949/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_05_good(void) { good1(); good2(); return; }
['gcc']
6,837
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06_bad() { if(STATIC_CONST_FIVE==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109950/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,838
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109950/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_06_good(void) { good1(); good2(); return; }
['gcc']
6,839
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07_bad() { if(staticFive==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109951/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (staticFive == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,840
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109951/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_07_good(void) { good1(); good2(); return; }
['gcc']
6,841
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08_bad() { if(staticReturnsTrue()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109952/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,842
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109952/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_08_good(void) { good1(); good2(); return; }
['gcc']
6,843
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09_bad() { if(GLOBAL_CONST_TRUE) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109953/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (GLOBAL_CONST_TRUE != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,844
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109953/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_09_good(void) { good1(); good2(); return; }
['gcc']
6,845
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10_bad() { if(globalTrue) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109954/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (globalTrue != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,846
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109954/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_10_good(void) { good1(); good2(); return; }
['gcc']
6,847
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11_bad() { if(globalReturnsTrue()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109955/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,848
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109955/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_11_good(void) { good1(); good2(); return; }
['gcc']
6,849
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12_bad() { if(globalReturnsTrueOrFalse()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } else { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FIX: bind(), listen(), then accept() */ if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FIX: bind(), listen(), then accept() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109956/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12_bad(void) { int iVar1; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined4 uStack_88; undefined2 uStack_78; undefined2 uStack_76; undefined4 uStack_74; undefined2 uStack_68; undefined2 uStack_66; undefined4 uStack_64; undefined *puStack_50; int iStack_44; long lStack_40; int iStack_34; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; iStack_14 = 0xffffffff; iStack_10 = -1; lStack_20 = func_0x00400c60(&uStack_e8); iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_78,0,0x10); uStack_78 = 2; uStack_74 = 0; uStack_76 = func_0x00400c70(0x6987); iVar1 = func_0x00400d40(iStack_14,&uStack_78,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d30(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d50(iStack_14,0,0), iStack_10 != -1)) && ((iStack_24 = func_0x00400c30(iStack_10,(long)&uStack_e8 + lStack_20, (long)(99 - (int)lStack_20),0), iStack_24 != -1 && (iStack_24 != 0)))) { *(undefined *)((long)&uStack_e8 + (long)iStack_24) = 0; puStack_30 = (undefined *)func_0x00400c80(&uStack_e8,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c80(&uStack_e8,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } printLine(&uStack_e8); } else { uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; iStack_34 = 0xffffffff; iStack_c = -1; lStack_40 = func_0x00400c60(&uStack_e8); iStack_34 = func_0x00400d80(2,1,6); if (iStack_34 != -1) { func_0x00400ca0(&uStack_68,0,0x10); uStack_68 = 2; uStack_64 = 0; uStack_66 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_34,0,0); if (((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_34,&uStack_68,0x10), iVar1 != -1)) && ((iVar1 = func_0x00400d30(iStack_34,5), iVar1 != -1 && ((iStack_44 = func_0x00400c30(iStack_c,(long)&uStack_e8 + lStack_40, (long)(99 - (int)lStack_40),0), iStack_44 != -1 && (iStack_44 != 0)))))) { *(undefined *)((long)&uStack_e8 + (long)iStack_44) = 0; puStack_50 = (undefined *)func_0x00400c80(&uStack_e8,0xd); if (puStack_50 != (undefined *)0x0) { *puStack_50 = 0; } puStack_50 = (undefined *)func_0x00400c80(&uStack_e8,10); if (puStack_50 != (undefined *)0x0) { *puStack_50 = 0; } } } if (iStack_34 != -1) { func_0x00400cb0(iStack_34); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_e8); } return; }
['gcc']
6,850
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109956/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_12_good(void) { good1(); return; }
['gcc']
6,851
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13_bad() { if(GLOBAL_CONST_FIVE==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109957/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (GLOBAL_CONST_FIVE == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,852
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109957/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_13_good(void) { good1(); good2(); return; }
['gcc']
6,853
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14_bad() { if(globalFive==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109958/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (globalFive == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,854
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109958/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_14_good(void) { good1(); good2(); return; }
['gcc']
6,855
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15_bad() { switch(6) { case 6: { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109959/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,856
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109959/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_15_good(void) { good1(); good2(); return; }
['gcc']
6,857
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16_bad() { while(1) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } break; } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109960/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,858
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109960/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_16_good(void) { good1(); return; }
['gcc']
6,859
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_bad() { int j; for(j = 0; j < 1; j++) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109961/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_bad(void) { int iVar1; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; iStack_14 = 0xffffffff; iStack_10 = -1; lStack_20 = func_0x00400c60(&uStack_b8); iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400c70(0x6987); iStack_10 = func_0x00400d50(iStack_14,0,0); if ((((iStack_10 != -1) && (iVar1 = func_0x00400d40(iStack_14,&uStack_48,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_14,5), iVar1 != -1)) && ((iStack_24 = func_0x00400c30(iStack_10,(long)&uStack_b8 + lStack_20, (long)(99 - (int)lStack_20),0), iStack_24 != -1 && (iStack_24 != 0)))) { *(undefined *)((long)&uStack_b8 + (long)iStack_24) = 0; puStack_30 = (undefined *)func_0x00400c80(&uStack_b8,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c80(&uStack_b8,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } printLine(&uStack_b8); } return; }
['gcc']
6,860
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109961/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_17_good(void) { good1(); return; }
['gcc']
6,861
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18_bad() { goto sink; sink: { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), bind(), then listen */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } }
['/* FLAW: Attempt to accept(), bind(), then listen */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109962/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,862
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109962/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_bind_listen_18_good(void) { good1(); return; }
['gcc']
6,863
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01_bad() { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109963/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,864
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109963/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_01_good(void) { good1(); return; }
['gcc']
6,865
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02_bad() { if(1) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109964/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,866
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109964/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_02_good(void) { good1(); good2(); return; }
['gcc']
6,867
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03_bad() { if(5==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109965/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,868
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109965/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_03_good(void) { good1(); good2(); return; }
['gcc']
6,869
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_bad() { if(STATIC_CONST_TRUE) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109966/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,870
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109966/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_04_good(void) { good1(); good2(); return; }
['gcc']
6,871
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05_bad() { if(staticTrue) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109967/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (staticTrue != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,872
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109967/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_05_good(void) { good1(); good2(); return; }
['gcc']
6,873
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06_bad() { if(STATIC_CONST_FIVE==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109968/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,874
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109968/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_06_good(void) { good1(); good2(); return; }
['gcc']
6,875
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07_bad() { if(staticFive==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109969/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (staticFive == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,876
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109969/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_07_good(void) { good1(); good2(); return; }
['gcc']
6,877
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_bad() { if(staticReturnsTrue()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109970/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,878
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109970/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_08_good(void) { good1(); good2(); return; }
['gcc']
6,879
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09_bad() { if(GLOBAL_CONST_TRUE) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109971/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (GLOBAL_CONST_TRUE != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,880
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109971/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_09_good(void) { good1(); good2(); return; }
['gcc']
6,881
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10_bad() { if(globalTrue) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109972/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (globalTrue != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,882
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109972/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_10_good(void) { good1(); good2(); return; }
['gcc']
6,883
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11_bad() { if(globalReturnsTrue()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109973/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,884
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109973/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_11_good(void) { good1(); good2(); return; }
['gcc']
6,885
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12_bad() { if(globalReturnsTrueOrFalse()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } else { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FIX: bind(), listen(), then accept() */ if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FIX: bind(), listen(), then accept() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109974/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12_bad(void) { int iVar1; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined4 uStack_88; undefined2 uStack_78; undefined2 uStack_76; undefined4 uStack_74; undefined2 uStack_68; undefined2 uStack_66; undefined4 uStack_64; undefined *puStack_50; int iStack_44; long lStack_40; int iStack_34; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; iStack_14 = 0xffffffff; iStack_10 = -1; lStack_20 = func_0x00400c60(&uStack_e8); iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_78,0,0x10); uStack_78 = 2; uStack_74 = 0; uStack_76 = func_0x00400c70(0x6987); iVar1 = func_0x00400d40(iStack_14,&uStack_78,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d30(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d50(iStack_14,0,0), iStack_10 != -1)) && ((iStack_24 = func_0x00400c30(iStack_10,(long)&uStack_e8 + lStack_20, (long)(99 - (int)lStack_20),0), iStack_24 != -1 && (iStack_24 != 0)))) { *(undefined *)((long)&uStack_e8 + (long)iStack_24) = 0; puStack_30 = (undefined *)func_0x00400c80(&uStack_e8,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c80(&uStack_e8,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } printLine(&uStack_e8); } else { uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; iStack_34 = 0xffffffff; iStack_c = -1; lStack_40 = func_0x00400c60(&uStack_e8); iStack_34 = func_0x00400d80(2,1,6); if (iStack_34 != -1) { func_0x00400ca0(&uStack_68,0,0x10); uStack_68 = 2; uStack_64 = 0; uStack_66 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_34,0,0); if (((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_34,5), iVar1 != -1)) && ((iVar1 = func_0x00400d40(iStack_34,&uStack_68,0x10), iVar1 != -1 && ((iStack_44 = func_0x00400c30(iStack_c,(long)&uStack_e8 + lStack_40, (long)(99 - (int)lStack_40),0), iStack_44 != -1 && (iStack_44 != 0)))))) { *(undefined *)((long)&uStack_e8 + (long)iStack_44) = 0; puStack_50 = (undefined *)func_0x00400c80(&uStack_e8,0xd); if (puStack_50 != (undefined *)0x0) { *puStack_50 = 0; } puStack_50 = (undefined *)func_0x00400c80(&uStack_e8,10); if (puStack_50 != (undefined *)0x0) { *puStack_50 = 0; } } } if (iStack_34 != -1) { func_0x00400cb0(iStack_34); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_e8); } return; }
['gcc']
6,886
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109974/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_12_good(void) { good1(); return; }
['gcc']
6,887
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13_bad() { if(GLOBAL_CONST_FIVE==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109975/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (GLOBAL_CONST_FIVE == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,888
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109975/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_13_good(void) { good1(); good2(); return; }
['gcc']
6,889
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14_bad() { if(globalFive==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109976/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; if (globalFive == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
6,890
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109976/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_14_good(void) { good1(); good2(); return; }
['gcc']
6,891
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15_bad() { switch(6) { case 6: { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109977/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,892
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109977/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_15_good(void) { good1(); good2(); return; }
['gcc']
6,893
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16_bad() { while(1) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } break; } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109978/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,894
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109978/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_16_good(void) { good1(); return; }
['gcc']
6,895
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17_bad() { int j; for(j = 0; j < 1; j++) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109979/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17_bad(void) { int iVar1; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; iStack_14 = 0xffffffff; iStack_10 = -1; lStack_20 = func_0x00400c60(&uStack_b8); iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400c70(0x6987); iStack_10 = func_0x00400d50(iStack_14,0,0); if ((((iStack_10 != -1) && (iVar1 = func_0x00400d30(iStack_14,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_14,&uStack_48,0x10), iVar1 != -1)) && ((iStack_24 = func_0x00400c30(iStack_10,(long)&uStack_b8 + lStack_20, (long)(99 - (int)lStack_20),0), iStack_24 != -1 && (iStack_24 != 0)))) { *(undefined *)((long)&uStack_b8 + (long)iStack_24) = 0; puStack_30 = (undefined *)func_0x00400c80(&uStack_b8,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c80(&uStack_b8,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } printLine(&uStack_b8); } return; }
['gcc']
6,896
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109979/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_17_good(void) { good1(); return; }
['gcc']
6,897
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18_bad() { goto sink; sink: { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to accept(), listen(), then bind() */ acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } }
['/* FLAW: Attempt to accept(), listen(), then bind() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109980/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iStack_c = func_0x00400d50(iStack_10,0,0); if ((((iStack_c != -1) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && (iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
6,898
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109980/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18_good
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__accept_listen_bind_18_good(void) { good1(); return; }
['gcc']
6,899
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__bind_accept_listen_01_bad() { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); /* FLAW: Attempt to bind(), accept(), then listen() */ if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, (char *)data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } }
['/* FLAW: Attempt to bind(), accept(), then listen() */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE666']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109981/CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__bind_accept_listen_01.c
CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__bind_accept_listen_01_bad
void CWE666_Operation_on_Resource_in_Wrong_Phase_of_Lifetime__bind_accept_listen_01_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400c60(&uStack_a8); iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d40(iStack_10,&uStack_38,0x10); if ((((iVar1 != -1) && (iStack_c = func_0x00400d50(iStack_10,0,0), iStack_c != -1)) && (iVar1 = func_0x00400d30(iStack_10,5), iVar1 != -1)) && ((iStack_1c = func_0x00400c30(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_1c != -1 && (iStack_1c != 0)))) { *(undefined *)((long)&uStack_a8 + (long)iStack_1c) = 0; puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400c80(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } printLine(&uStack_a8); return; }
['gcc']