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
50,500
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54_good(void) { goodG2B(); return; }
['gcc']
50,501
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b_badSink(undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_badSink(param_1); return; }
['gcc']
50,502
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54b_goodG2BSink(undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_goodG2BSink(param_1); return; }
['gcc']
50,503
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_badSink(undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_badSink(param_1); return; }
['gcc']
50,504
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54c_goodG2BSink(undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_goodG2BSink(param_1); return; }
['gcc']
50,505
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_badSink(undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_badSink(param_1); return; }
['gcc']
50,506
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54d_goodG2BSink(undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_goodG2BSink(param_1); return; }
['gcc']
50,507
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_badSink(int data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_badSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,508
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_goodG2BSink(int data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87998/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_54e_goodG2BSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,509
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61_bad() { int data; /* Initialize data */ data = -1; data = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_badSource(data); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87999/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61_bad(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = 0xffffffff; iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_badSource(0xffffffff); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,510
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87999/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61_good(void) { goodG2B(); return; }
['gcc']
50,511
int CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_badSource(int data) { /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); return data; }
['/* POTENTIAL FLAW: Read data from the console using fscanf() */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87999/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_badSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_badSource(undefined4 param_1) { undefined4 uStack_c; uStack_c = param_1; func_0x00400ab0(stdin,&UNK_004012e4,&uStack_c); return uStack_c; }
['gcc']
50,512
int CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_goodG2BSource(int data) { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; return data; }
['/* FIX: Use a positive integer less than &InitialDataSize&*/']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87999/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_goodG2BSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_61b_goodG2BSource(void) { return 99; }
['gcc']
50,513
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63_bad() { int data; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fscanf() */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88001/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63_bad(void) { undefined4 uStack_c; uStack_c = 0xffffffff; func_0x00400ab0(stdin,&UNK_004012f4,&uStack_c); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_badSink(&uStack_c); return; }
['gcc']
50,514
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88001/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63_good(void) { goodG2B(); return; }
['gcc']
50,515
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_badSink(int * dataPtr) { int data = *dataPtr; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88001/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_badSink(int *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,516
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_goodG2BSink(int * dataPtr) { int data = *dataPtr; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88001/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_63b_goodG2BSink(int *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,517
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64_bad() { int data; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fscanf() */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88002/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64_bad(void) { undefined4 uStack_c; uStack_c = 0xffffffff; func_0x00400ab0(stdin,&UNK_00401304,&uStack_c); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_badSink(&uStack_c); return; }
['gcc']
50,518
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88002/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64_good(void) { goodG2B(); return; }
['gcc']
50,519
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int * dataPtr = (int *)dataVoidPtr; /* dereference dataPtr into data */ int data = (*dataPtr); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88002/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_badSink(int *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_14; int *piStack_10; iStack_14 = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; piStack_10 = param_1; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_14 < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)iStack_14); *(undefined *)((long)&uStack_78 + (long)iStack_14) = 0; } printLine(&uStack_78); return; }
['gcc']
50,520
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int * dataPtr = (int *)dataVoidPtr; /* dereference dataPtr into data */ int data = (*dataPtr); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88002/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_64b_goodG2BSink(int *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_14; int *piStack_10; iStack_14 = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; piStack_10 = param_1; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_14 < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_14); *(undefined *)((long)&uStack_78 + (long)iStack_14) = 0; } printLine(&uStack_78); return; }
['gcc']
50,521
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65_bad() { int data; /* define a function pointer */ void (*funcPtr) (int) = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_badSink; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fscanf() */', '/* use the function pointer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88003/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65_bad(void) { undefined4 uStack_14; code *pcStack_10; pcStack_10 = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_badSink; uStack_14 = 0xffffffff; func_0x00400ab0(stdin,&UNK_004012f4,&uStack_14); (*pcStack_10)(uStack_14); return; }
['gcc']
50,522
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88003/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65_good(void) { goodG2B(); return; }
['gcc']
50,523
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_badSink(int data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88003/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_badSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,524
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_goodG2BSink(int data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88003/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_65b_goodG2BSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,525
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66_bad() { int data; int dataArray[5]; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); /* put data in array */ dataArray[2] = data; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_badSink(dataArray); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fscanf() */', '/* put data in array */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88004/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66_bad(void) { undefined auStack_28 [8]; undefined4 uStack_20; undefined4 uStack_c; uStack_c = 0xffffffff; func_0x00400ab0(stdin,&UNK_00401304,&uStack_c); uStack_20 = uStack_c; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_badSink(auStack_28); return; }
['gcc']
50,526
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88004/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66_good(void) { goodG2B(); return; }
['gcc']
50,527
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_badSink(int dataArray[]) { /* copy data out of dataArray */ int data = dataArray[2]; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* copy data out of dataArray */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88004/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_badSink(long param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = *(int *)(param_1 + 8); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,528
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_goodG2BSink(int dataArray[]) { int data = dataArray[2]; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88004/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_66b_goodG2BSink(long param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = *(int *)(param_1 + 8); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,529
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_bad() { int data; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_structType myStruct; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); myStruct.structFirst = data; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_badSink(myStruct); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fscanf() */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88005/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_bad(void) { undefined4 uStack_c; uStack_c = 0xffffffff; func_0x00400ab0(stdin,&UNK_004012f4,&uStack_c); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_badSink(uStack_c); return; }
['gcc']
50,530
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88005/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_good(void) { goodG2B(); return; }
['gcc']
50,531
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_badSink(CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_structType myStruct) { int data = myStruct.structFirst; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88005/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_badSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; iStack_c = param_1; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,532
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_goodG2BSink(CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67_structType myStruct) { int data = myStruct.structFirst; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88005/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_67b_goodG2BSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; iStack_c = param_1; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,533
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_bad() { int data; /* Initialize data */ data = -1; /* POTENTIAL FLAW: Read data from the console using fscanf() */ fscanf(stdin, "%d", &data); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_badData = data; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fscanf() */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88006/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_bad(void) { undefined4 uStack_c; uStack_c = 0xffffffff; func_0x00400ab0(stdin,&UNK_004012f4,&uStack_c); CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_badData = uStack_c; CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_badSink(); return; }
['gcc']
50,534
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88006/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68a.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_good
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_good(void) { goodG2B(); return; }
['gcc']
50,535
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_badSink() { int data = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_badData; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88006/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_badSink(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_badData; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400af0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400aa0(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,536
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_goodG2BSink() { int data = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_goodG2BData; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88006/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b.c
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68b_goodG2BSink(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_strncpy_68_goodG2BData; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,537
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88014/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,538
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88014/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_01_good(void) { goodG2B(); return; }
['gcc']
50,539
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_bad() { int data; /* Initialize data */ data = -1; if(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88015/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,540
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88015/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_02_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,541
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03_bad() { int data; /* Initialize data */ data = -1; if(5==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88016/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,542
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88016/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,543
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04_bad() { int data; /* Initialize data */ data = -1; if(STATIC_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88017/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,544
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88017/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,545
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_bad() { int data; /* Initialize data */ data = -1; if(staticTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88018/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (staticTrue != 0) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,546
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88018/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,547
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06_bad() { int data; /* Initialize data */ data = -1; if(STATIC_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88019/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,548
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88019/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_06_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,549
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17_bad() { int i; int data; /* Initialize data */ data = -1; for(i = 0; i < 1; i++) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88030/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_28; int iStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_10 = -1; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { iStack_24 = 0xffffffff; iStack_14 = -1; iStack_24 = func_0x00400dd0(2,1,6); if (iStack_24 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_24,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_24,5), iVar1 != -1)) && (iStack_14 = func_0x00400d90(iStack_24,0,0), iStack_14 != -1)) && ((iStack_28 = func_0x00400c80(iStack_14,auStack_46,0xd,0), iStack_28 != -1 && (iStack_28 != 0)))) { auStack_46[iStack_28] = 0; iStack_10 = func_0x00400da0(auStack_46); } } if (iStack_24 != -1) { func_0x00400ce0(iStack_24); } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } } if (iStack_10 < 100) { lStack_20 = func_0x00400d40((long)iStack_10); func_0x00400cd0(lStack_20,0x41,(long)(iStack_10 + -1)); *(undefined *)(lStack_20 + (long)iStack_10 + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,550
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88030/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_17_good(void) { goodG2B(); return; }
['gcc']
50,551
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18_bad() { int data; /* Initialize data */ data = -1; goto source; source: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88031/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c70(lStack_20); } return; }
['gcc']
50,552
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88031/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_18_good(void) { goodG2B(); return; }
['gcc']
50,553
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21_bad() { int data; /* Initialize data */ data = -1; badStatic = 1; /* true */ data = badSource(data); /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* true */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88032/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21_bad(void) { int iVar1; long lVar2; badStatic = 1; iVar1 = badSource(0xffffffff); if (iVar1 < 100) { lVar2 = func_0x00400d40((long)iVar1); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,554
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88032/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_21_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,555
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_bad() { int data; /* Initialize data */ data = -1; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badGlobal = 1; /* true */ data = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badSource(data); /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* true */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88033/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_bad(void) { int iVar1; long lVar2; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badGlobal = 1; iVar1 = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badSource(0xffffffff); if (iVar1 < 100) { lVar2 = func_0x00400d40((long)iVar1); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,556
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88033/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,557
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badSource(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badGlobal) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } return data; }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88033/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badSource(undefined4 param_1) { int iVar1; undefined4 uStack_3c; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; int iStack_c; uStack_3c = param_1; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_badGlobal != 0) { iStack_10 = 0xffffffff; iStack_c = -1; iStack_10 = func_0x00400dd0(2,1,6); if (iStack_10 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_10,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_10,5), iVar1 != -1)) && (iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) && ((iStack_14 = func_0x00400c80(iStack_c,auStack_36,0xd,0), iStack_14 != -1 && (iStack_14 != 0)))) { auStack_36[iStack_14] = 0; uStack_3c = func_0x00400da0(auStack_36); } } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c != -1) { func_0x00400ce0(iStack_c); } } return uStack_3c; }
['gcc']
50,558
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B1Source(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } return data; }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a positive integer less than &InitialDataSize&*/']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88033/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B1Source
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B1Source (undefined4 param_1) { undefined4 uStack_c; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B1Global == 0) { uStack_c = 99; } else { printLine(&UNK_00401314); uStack_c = param_1; } return uStack_c; }
['gcc']
50,559
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B2Source(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B2Global) { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } return data; }
['/* FIX: Use a positive integer less than &InitialDataSize&*/']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88033/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B2Source
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B2Source (undefined4 param_1) { undefined4 uStack_c; uStack_c = param_1; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_22_goodG2B2Global != 0) { uStack_c = 99; } return uStack_c; }
['gcc']
50,560
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { int dataCopy = data; int data = dataCopy; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88034/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_28; int iStack_20; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } iStack_1c = iStack_c; iStack_20 = iStack_c; if (iStack_c < 100) { lStack_28 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_28,0x41,(long)(iStack_20 + -1)); *(undefined *)(lStack_28 + (long)iStack_20 + -1) = 0; printLine(lStack_28); func_0x00400c70(lStack_28); } return; }
['gcc']
50,561
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88034/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_31_good(void) { goodG2B(); return; }
['gcc']
50,562
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32_bad() { int data; int *dataPtr1 = &data; int *dataPtr2 = &data; /* Initialize data */ data = -1; { int data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { int data = *dataPtr2; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88035/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32_bad(void) { int iVar1; undefined auStack_66 [14]; undefined2 uStack_58; undefined2 uStack_56; undefined4 uStack_54; int iStack_3c; long lStack_38; int iStack_2c; int iStack_28; int iStack_24; int *piStack_20; int *piStack_18; int iStack_10; int iStack_c; piStack_18 = &iStack_3c; piStack_20 = &iStack_3c; iStack_3c = -1; iStack_c = -1; iStack_24 = 0xffffffff; iStack_10 = -1; iStack_24 = func_0x00400dd0(2,1,6); if (iStack_24 != -1) { func_0x00400cd0(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = 0; uStack_56 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_24,&uStack_58,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_24,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_24,0,0), iStack_10 != -1)) && ((iStack_28 = func_0x00400c80(iStack_10,auStack_66,0xd,0), iStack_28 != -1 && (iStack_28 != 0)))) { auStack_66[iStack_28] = 0; iStack_c = func_0x00400da0(auStack_66); } } if (iStack_24 != -1) { func_0x00400ce0(iStack_24); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } *piStack_18 = iStack_c; iStack_2c = *piStack_20; if (iStack_2c < 100) { lStack_38 = func_0x00400d40((long)iStack_2c); func_0x00400cd0(lStack_38,0x41,(long)(iStack_2c + -1)); *(undefined *)(lStack_38 + (long)iStack_2c + -1) = 0; printLine(lStack_38); func_0x00400c70(lStack_38); } return; }
['gcc']
50,563
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88035/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_32_good(void) { goodG2B(); return; }
['gcc']
50,564
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_bad() { int data; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_unionType myUnion; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { int data = myUnion.unionSecond; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88037/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_bad(void) { int iVar1; undefined auStack_56 [14]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; int iStack_2c; long lStack_28; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_56,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_56[iStack_18] = 0; iStack_c = func_0x00400da0(auStack_56); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } iStack_2c = iStack_c; iStack_1c = iStack_c; if (iStack_c < 100) { lStack_28 = func_0x00400d40((long)iStack_c); func_0x00400cd0(lStack_28,0x41,(long)(iStack_1c + -1)); *(undefined *)(lStack_28 + (long)iStack_1c + -1) = 0; printLine(lStack_28); func_0x00400c70(lStack_28); } return; }
['gcc']
50,565
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88037/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_34_good(void) { goodG2B(); return; }
['gcc']
50,566
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_badSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88038/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d40((long)param_1); func_0x00400cd0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c70(lVar1); } return; }
['gcc']
50,567
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88038/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_badSink(uStack_c); return; }
['gcc']
50,568
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_goodG2BSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88038/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_goodG2BSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
50,569
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88038/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_41_good(void) { goodG2B(); return; }
['gcc']
50,570
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42_bad() { int data; /* Initialize data */ data = -1; data = badSource(data); /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88039/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42_bad(void) { int iVar1; long lVar2; iVar1 = badSource(0xffffffff); if (iVar1 < 100) { lVar2 = func_0x00400d40((long)iVar1); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,571
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88039/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_42_good(void) { goodG2B(); return; }
['gcc']
50,572
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44_bad() { int data; /* define a function pointer */ void (*funcPtr) (int) = badSink; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* use the function pointer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88041/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; int iStack_10; undefined4 uStack_c; pcStack_18 = badSink; uStack_c = 0xffffffff; iStack_1c = 0xffffffff; iStack_10 = -1; iStack_1c = func_0x00400dd0(2,1,6); if (iStack_1c != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_1c,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_1c,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_1c,0,0), iStack_10 != -1)) && ((iStack_20 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_20 != -1 && (iStack_20 != 0)))) { auStack_46[iStack_20] = 0; uStack_c = func_0x00400da0(auStack_46); } } if (iStack_1c != -1) { func_0x00400ce0(iStack_1c); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } (*pcStack_18)(uStack_c); return; }
['gcc']
50,573
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88041/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_44_good(void) { goodG2B(); return; }
['gcc']
50,574
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_badData = data; badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88042/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_badData = uStack_c; badSink(); return; }
['gcc']
50,575
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88042/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_45_good(void) { goodG2B(); return; }
['gcc']
50,576
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88043/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_badSink(uStack_c); return; }
['gcc']
50,577
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88043/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51_good(void) { goodG2B(); return; }
['gcc']
50,578
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_badSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88043/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d40((long)param_1); func_0x00400cd0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c70(lVar1); } return; }
['gcc']
50,579
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_goodG2BSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88043/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_51b_goodG2BSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
50,580
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88044/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_badSink(uStack_c); return; }
['gcc']
50,581
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88044/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52_good(void) { goodG2B(); return; }
['gcc']
50,582
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88044/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_badSink(param_1); return; }
['gcc']
50,583
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88044/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52b_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_goodG2BSink(param_1); return; }
['gcc']
50,584
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_badSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88044/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d40((long)param_1); func_0x00400cd0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c70(lVar1); } return; }
['gcc']
50,585
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_goodG2BSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88044/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_52c_goodG2BSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
50,586
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_badSink(uStack_c); return; }
['gcc']
50,587
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53_good(void) { goodG2B(); return; }
['gcc']
50,588
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_badSink(param_1); return; }
['gcc']
50,589
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53b_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_goodG2BSink(param_1); return; }
['gcc']
50,590
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_badSink(param_1); return; }
['gcc']
50,591
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53c_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_goodG2BSink(param_1); return; }
['gcc']
50,592
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_badSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d40((long)param_1); func_0x00400cd0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c70(lVar1); } return; }
['gcc']
50,593
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_goodG2BSink(int data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88045/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_53d_goodG2BSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
50,594
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ 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); 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, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_badSink(uStack_c); return; }
['gcc']
50,595
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54_good(void) { goodG2B(); return; }
['gcc']
50,596
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_badSink(param_1); return; }
['gcc']
50,597
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54b_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_goodG2BSink(param_1); return; }
['gcc']
50,598
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_badSink(param_1); return; }
['gcc']
50,599
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54c_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_goodG2BSink(param_1); return; }
['gcc']