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
49,200
void CWE194_Unexpected_Sign_Extension__rand_strncpy_45_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); CWE194_Unexpected_Sign_Extension__rand_strncpy_45_badData = data; badSink(); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87418/CWE194_Unexpected_Sign_Extension__rand_strncpy_45.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_45_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_45_bad(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); CWE194_Unexpected_Sign_Extension__rand_strncpy_45_badData = uVar1 ^ (ushort)(iVar2 << 0xf); badSink(); return; }
['gcc']
49,201
void CWE194_Unexpected_Sign_Extension__rand_strncpy_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87418/CWE194_Unexpected_Sign_Extension__rand_strncpy_45.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_45_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_45_good(void) { goodG2B(); return; }
['gcc']
49,202
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_badSink(data); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87419/CWE194_Unexpected_Sign_Extension__rand_strncpy_51a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_51_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51_bad(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_badSink ((int)(short)(uVar1 ^ (ushort)(iVar2 << 0xf))); return; }
['gcc']
49,203
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87419/CWE194_Unexpected_Sign_Extension__rand_strncpy_51a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_51_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51_good(void) { goodG2B(); return; }
['gcc']
49,204
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_badSink(short 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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87419/CWE194_Unexpected_Sign_Extension__rand_strncpy_51b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_badSink(short 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)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
49,205
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_goodG2BSink(short 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 extension 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 extension 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/87419/CWE194_Unexpected_Sign_Extension__rand_strncpy_51b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_51b_goodG2BSink(short 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)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
49,206
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_badSink(data); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53_bad(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_badSink ((int)(short)(uVar1 ^ (ushort)(iVar2 << 0xf))); return; }
['gcc']
49,207
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53_good(void) { goodG2B(); return; }
['gcc']
49,208
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_badSink(short data) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_badSink((int)param_1); return; }
['gcc']
49,209
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_goodG2BSink((int)param_1); return; }
['gcc']
49,210
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_badSink(short data) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53c.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_badSink((int)param_1); return; }
['gcc']
49,211
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53c.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53c_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_goodG2BSink((int)param_1); return; }
['gcc']
49,212
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_badSink(short 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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53d.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_badSink(short 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)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
49,213
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_goodG2BSink(short 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 extension 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 extension 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/87421/CWE194_Unexpected_Sign_Extension__rand_strncpy_53d.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_53d_goodG2BSink(short 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)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
49,214
void CWE194_Unexpected_Sign_Extension__rand_strncpy_61_bad() { short data; /* Initialize data */ data = 0; data = CWE194_Unexpected_Sign_Extension__rand_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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87423/CWE194_Unexpected_Sign_Extension__rand_strncpy_61a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_61_bad
void CWE194_Unexpected_Sign_Extension__rand_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; short sStack_a; sStack_a = 0; sStack_a = CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_badSource(0); 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 (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,215
void CWE194_Unexpected_Sign_Extension__rand_strncpy_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87423/CWE194_Unexpected_Sign_Extension__rand_strncpy_61a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_61_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_61_good(void) { goodG2B(); return; }
['gcc']
49,216
short CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_badSource(short data) { /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); return data; }
['/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87423/CWE194_Unexpected_Sign_Extension__rand_strncpy_61b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_badSource
ushort CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_badSource(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); return uVar1 ^ (ushort)(iVar2 << 0xf); }
['gcc']
49,217
short CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_goodG2BSource(short 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/87423/CWE194_Unexpected_Sign_Extension__rand_strncpy_61b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_goodG2BSource
undefined2 CWE194_Unexpected_Sign_Extension__rand_strncpy_61b_goodG2BSource(void) { return 99; }
['gcc']
49,218
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_badSink(&data); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87425/CWE194_Unexpected_Sign_Extension__rand_strncpy_63a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_63_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63_bad(void) { int iVar1; ushort auStack_1a [5]; auStack_1a[0] = 0; func_0x00400ae0(); iVar1 = func_0x00400ae0(); auStack_1a[0] = func_0x00400ae0(); auStack_1a[0] = auStack_1a[0] ^ (ushort)(iVar1 << 0xf); CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_badSink(auStack_1a); return; }
['gcc']
49,219
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87425/CWE194_Unexpected_Sign_Extension__rand_strncpy_63a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_63_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63_good(void) { goodG2B(); return; }
['gcc']
49,220
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_badSink(short * dataPtr) { short 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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87425/CWE194_Unexpected_Sign_Extension__rand_strncpy_63b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_badSink(short *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; short sStack_a; sStack_a = *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 (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,221
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_goodG2BSink(short * dataPtr) { short 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 extension 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 extension 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/87425/CWE194_Unexpected_Sign_Extension__rand_strncpy_63b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_63b_goodG2BSink(short *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; short sStack_a; sStack_a = *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 (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,222
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65_bad() { short data; /* define a function pointer */ void (*funcPtr) (short) = CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_badSink; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */', '/* use the function pointer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87427/CWE194_Unexpected_Sign_Extension__rand_strncpy_65a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_65_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65_bad(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_badSink ((int)(short)(uVar1 ^ (ushort)(iVar2 << 0xf))); return; }
['gcc']
49,223
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87427/CWE194_Unexpected_Sign_Extension__rand_strncpy_65a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_65_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65_good(void) { goodG2B(); return; }
['gcc']
49,224
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_badSink(short 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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87427/CWE194_Unexpected_Sign_Extension__rand_strncpy_65b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_badSink(short 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)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
49,225
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_goodG2BSink(short 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 extension 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 extension 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/87427/CWE194_Unexpected_Sign_Extension__rand_strncpy_65b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_65b_goodG2BSink(short 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)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
49,226
void CWE194_Unexpected_Sign_Extension__rand_strncpy_66_bad() { short data; short dataArray[5]; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); /* put data in array */ dataArray[2] = data; CWE194_Unexpected_Sign_Extension__rand_strncpy_66b_badSink(dataArray); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */', '/* put data in array */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87428/CWE194_Unexpected_Sign_Extension__rand_strncpy_66a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_66_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_66_bad(void) { int iVar1; undefined auStack_24 [4]; ushort uStack_20; ushort uStack_1a; uStack_1a = 0; func_0x00400ae0(); iVar1 = func_0x00400ae0(); uStack_20 = func_0x00400ae0(); uStack_20 = uStack_20 ^ (ushort)(iVar1 << 0xf); uStack_1a = uStack_20; CWE194_Unexpected_Sign_Extension__rand_strncpy_66b_badSink(auStack_24); return; }
['gcc']
49,227
void CWE194_Unexpected_Sign_Extension__rand_strncpy_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87428/CWE194_Unexpected_Sign_Extension__rand_strncpy_66a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_66_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_66_good(void) { goodG2B(); return; }
['gcc']
49,228
void CWE194_Unexpected_Sign_Extension__rand_strncpy_66b_badSink(short dataArray[]) { /* copy data out of dataArray */ short 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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87428/CWE194_Unexpected_Sign_Extension__rand_strncpy_66b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_66b_badSink
void CWE194_Unexpected_Sign_Extension__rand_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; short sStack_a; sStack_a = *(short *)(param_1 + 4); 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 (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,229
void CWE194_Unexpected_Sign_Extension__rand_strncpy_66b_goodG2BSink(short dataArray[]) { short 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 extension 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 extension 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/87428/CWE194_Unexpected_Sign_Extension__rand_strncpy_66b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_66b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_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; short sStack_a; sStack_a = *(short *)(param_1 + 4); 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 (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,230
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67_bad() { short data; CWE194_Unexpected_Sign_Extension__rand_strncpy_67_structType myStruct; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); myStruct.structFirst = data; CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_badSink(myStruct); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87429/CWE194_Unexpected_Sign_Extension__rand_strncpy_67a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_67_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67_bad(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_badSink(uVar1 ^ (ushort)(iVar2 << 0xf)); return; }
['gcc']
49,231
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87429/CWE194_Unexpected_Sign_Extension__rand_strncpy_67a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_67_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67_good(void) { goodG2B(); return; }
['gcc']
49,232
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_badSink(CWE194_Unexpected_Sign_Extension__rand_strncpy_67_structType myStruct) { short 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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87429/CWE194_Unexpected_Sign_Extension__rand_strncpy_67b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_badSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_badSink(short 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; short sStack_a; 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; sStack_a = param_1; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,233
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_goodG2BSink(CWE194_Unexpected_Sign_Extension__rand_strncpy_67_structType myStruct) { short 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 extension 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 extension 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/87429/CWE194_Unexpected_Sign_Extension__rand_strncpy_67b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_strncpy_67b_goodG2BSink(short 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; short sStack_a; 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; sStack_a = param_1; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,234
void CWE194_Unexpected_Sign_Extension__rand_strncpy_68_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a random value that could be less than 0 */ data = (short)RAND32(); CWE194_Unexpected_Sign_Extension__rand_strncpy_68_badData = data; CWE194_Unexpected_Sign_Extension__rand_strncpy_68b_badSink(); }
['/* Initialize data */', '/* FLAW: Use a random value that could be less than 0 */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87430/CWE194_Unexpected_Sign_Extension__rand_strncpy_68a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_68_bad
void CWE194_Unexpected_Sign_Extension__rand_strncpy_68_bad(void) { ushort uVar1; int iVar2; func_0x00400ae0(); iVar2 = func_0x00400ae0(); uVar1 = func_0x00400ae0(); CWE194_Unexpected_Sign_Extension__rand_strncpy_68_badData = uVar1 ^ (ushort)(iVar2 << 0xf); CWE194_Unexpected_Sign_Extension__rand_strncpy_68b_badSink(); return; }
['gcc']
49,235
void CWE194_Unexpected_Sign_Extension__rand_strncpy_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87430/CWE194_Unexpected_Sign_Extension__rand_strncpy_68a.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_68_good
void CWE194_Unexpected_Sign_Extension__rand_strncpy_68_good(void) { goodG2B(); return; }
['gcc']
49,236
void CWE194_Unexpected_Sign_Extension__rand_strncpy_68b_badSink() { short data = CWE194_Unexpected_Sign_Extension__rand_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 extension 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 extension could result in a very large number */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87430/CWE194_Unexpected_Sign_Extension__rand_strncpy_68b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_68b_badSink
void CWE194_Unexpected_Sign_Extension__rand_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; short sStack_a; sStack_a = CWE194_Unexpected_Sign_Extension__rand_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_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,237
void CWE194_Unexpected_Sign_Extension__rand_strncpy_68b_goodG2BSink() { short data = CWE194_Unexpected_Sign_Extension__rand_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 extension 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 extension 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/87430/CWE194_Unexpected_Sign_Extension__rand_strncpy_68b.c
CWE194_Unexpected_Sign_Extension__rand_strncpy_68b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__rand_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; short sStack_a; sStack_a = CWE194_Unexpected_Sign_Extension__rand_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 (sStack_a < 100) { func_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
49,238
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87438/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_01.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_01_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,239
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_01_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87438/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_01.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_01_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_01_good(void) { goodG2B(); return; }
['gcc']
49,240
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87439/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_02.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_02_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,241
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_02_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87439/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_02.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_02_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_02_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,242
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87440/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_03.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_03_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,243
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87440/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_03.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_03_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,244
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87441/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_04.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_04_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_0040153c); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,245
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87441/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_04.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_04_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,246
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87442/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_05.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_05_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; if (staticTrue != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,247
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87442/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_05.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_05_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,248
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87443/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_06.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_06_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401548); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,249
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_06_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87443/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_06.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_06_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_06_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,250
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07_bad() { int data; /* Initialize data */ data = -1; if(staticFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87444/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (staticFive == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,251
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87444/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_07_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,252
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08_bad() { int data; /* Initialize data */ data = -1; if(staticReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87445/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401554); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,253
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87445/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_08_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,254
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09_bad() { int data; /* Initialize data */ data = -1; if(GLOBAL_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87446/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (GLOBAL_CONST_TRUE != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,255
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87446/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_09_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,256
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10_bad() { int data; /* Initialize data */ data = -1; if(globalTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87447/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (globalTrue != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,257
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87447/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_10_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,258
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11_bad() { int data; /* Initialize data */ data = -1; if(globalReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87448/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,259
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87448/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_11_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,260
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12_bad() { int data; /* Initialize data */ data = -1; if(globalReturnsTrueOrFalse()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } else { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } /* 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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* FIX: Use a positive integer less than &InitialDataSize&*/', '/* 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/87449/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { iStack_c = 99; } else { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,261
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87449/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_12_good(void) { goodG2B(); return; }
['gcc']
49,262
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13_bad() { int data; /* Initialize data */ data = -1; if(GLOBAL_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87450/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (GLOBAL_CONST_FIVE == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,263
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87450/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_13_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,264
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_bad() { int data; /* Initialize data */ data = -1; if(globalFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87451/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (globalFive == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,265
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87451/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_14_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,266
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15_bad() { int data; /* Initialize data */ data = -1; switch(6) { case 6: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } /* 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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* 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/87452/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,267
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87452/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_15_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,268
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16_bad() { int data; /* Initialize data */ data = -1; while(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; } /* 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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87453/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,269
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87453/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_16_good(void) { goodG2B(); return; }
['gcc']
49,270
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87454/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; long lStack_18; int iStack_10; int iStack_c; iStack_10 = -1; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401544); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_46,0xd,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_46[iStack_20] = 0; iStack_10 = func_0x00400d50(auStack_46); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } } if (iStack_10 < 100) { lStack_18 = func_0x00400d20((long)iStack_10); func_0x00400ca0(lStack_18,0x41,(long)(iStack_10 + -1)); *(undefined *)(lStack_18 + (long)iStack_10 + -1) = 0; printLine(lStack_18); func_0x00400c40(lStack_18); } return; }
['gcc']
49,271
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87454/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_17_good(void) { goodG2B(); return; }
['gcc']
49,272
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87455/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_18.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_18_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_c + -1)); *(undefined *)(lStack_20 + (long)iStack_c + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,273
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_18_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87455/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_18.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_18_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_18_good(void) { goodG2B(); return; }
['gcc']
49,274
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87456/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21_bad(void) { int iVar1; long lVar2; badStatic = 1; iVar1 = badSource(0xffffffff); if (iVar1 < 100) { lVar2 = func_0x00400d20((long)iVar1); func_0x00400ca0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c40(lVar2); } return; }
['gcc']
49,275
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87456/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_21_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,276
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_bad() { int data; /* Initialize data */ data = -1; CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badGlobal = 1; /* true */ data = CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87457/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22a.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_bad(void) { int iVar1; long lVar2; CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badGlobal = 1; iVar1 = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badSource(0xffffffff) ; if (iVar1 < 100) { lVar2 = func_0x00400d20((long)iVar1); func_0x00400ca0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c40(lVar2); } return; }
['gcc']
49,277
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87457/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22a.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
49,278
int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badSource(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badGlobal) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87457/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_10; int iStack_c; uStack_3c = param_1; if (CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_badGlobal != 0) { iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401564); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_36,0xd,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_36[iStack_10] = 0; uStack_3c = func_0x00400d50(auStack_36); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } } return uStack_3c; }
['gcc']
49,279
int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B1Source(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87457/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B1Source
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B1Source (undefined4 param_1) { undefined4 uStack_c; if (CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B1Global == 0) { uStack_c = 99; } else { printLine(&UNK_00401314); uStack_c = param_1; } return uStack_c; }
['gcc']
49,280
int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B2Source(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87457/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B2Source
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B2Source (undefined4 param_1) { undefined4 uStack_c; uStack_c = param_1; if (CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_22_goodG2B2Global != 0) { uStack_c = 99; } return uStack_c; }
['gcc']
49,281
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87458/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_31.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_31_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_1c; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } iStack_18 = iStack_c; iStack_1c = iStack_c; if (iStack_c < 100) { lStack_28 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_28,0x41,(long)(iStack_1c + -1)); *(undefined *)(lStack_28 + (long)iStack_1c + -1) = 0; printLine(lStack_28); func_0x00400c40(lStack_28); } return; }
['gcc']
49,282
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_31_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87458/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_31.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_31_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_31_good(void) { goodG2B(); return; }
['gcc']
49,283
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87459/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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_c; piStack_18 = &iStack_3c; piStack_20 = &iStack_3c; iStack_3c = -1; iStack_c = -1; iStack_24 = 0xffffffff; iStack_24 = func_0x00400d90(2,1,6); if (iStack_24 != -1) { func_0x00400ca0(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = func_0x00400cf0(&UNK_00401554); uStack_56 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_24,&uStack_58,0x10); if (((iVar1 != -1) && (iStack_28 = func_0x00400c50(iStack_24,auStack_66,0xd,0), iStack_28 != -1) ) && (iStack_28 != 0)) { auStack_66[iStack_28] = 0; iStack_c = func_0x00400d50(auStack_66); } } if (iStack_24 != -1) { func_0x00400cb0(iStack_24); } *piStack_18 = iStack_c; iStack_2c = *piStack_20; if (iStack_2c < 100) { lStack_38 = func_0x00400d20((long)iStack_2c); func_0x00400ca0(lStack_38,0x41,(long)(iStack_2c + -1)); *(undefined *)(lStack_38 + (long)iStack_2c + -1) = 0; printLine(lStack_38); func_0x00400c40(lStack_38); } return; }
['gcc']
49,284
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87459/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_32_good(void) { goodG2B(); return; }
['gcc']
49,285
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_bad() { int data; CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_unionType myUnion; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87461/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_24; long lStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } iStack_24 = iStack_c; iStack_18 = iStack_c; if (iStack_c < 100) { lStack_20 = func_0x00400d20((long)iStack_c); func_0x00400ca0(lStack_20,0x41,(long)(iStack_18 + -1)); *(undefined *)(lStack_20 + (long)iStack_18 + -1) = 0; printLine(lStack_20); func_0x00400c40(lStack_20); } return; }
['gcc']
49,286
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87461/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_34_good(void) { goodG2B(); return; }
['gcc']
49,287
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87462/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d20((long)param_1); func_0x00400ca0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c40(lVar1); } return; }
['gcc']
49,288
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87462/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401544); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_badSink(uStack_c); return; }
['gcc']
49,289
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87462/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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']
49,290
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87462/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_41_good(void) { goodG2B(); return; }
['gcc']
49,291
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87463/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42_bad(void) { int iVar1; long lVar2; iVar1 = badSource(0xffffffff); if (iVar1 < 100) { lVar2 = func_0x00400d20((long)iVar1); func_0x00400ca0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c40(lVar2); } return; }
['gcc']
49,292
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87463/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_42_good(void) { goodG2B(); return; }
['gcc']
49,293
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87465/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_44.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_44_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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; undefined4 uStack_c; pcStack_18 = badSink; uStack_c = 0xffffffff; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401554); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_46,0xd,0), iStack_20 != -1) ) && (iStack_20 != 0)) { auStack_46[iStack_20] = 0; uStack_c = func_0x00400d50(auStack_46); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } (*pcStack_18)(uStack_c); return; }
['gcc']
49,294
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_44_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87465/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_44.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_44_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_44_good(void) { goodG2B(); return; }
['gcc']
49,295
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_badData = data; badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87466/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_badData = uStack_c; badSink(); return; }
['gcc']
49,296
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87466/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_45_good(void) { goodG2B(); return; }
['gcc']
49,297
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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 connectSocket = 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 connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87467/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51a.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401544); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51b_badSink(uStack_c); return; }
['gcc']
49,298
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87467/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51a.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51_good
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51_good(void) { goodG2B(); return; }
['gcc']
49,299
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_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/87467/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51b.c
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_malloc_51b_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d20((long)param_1); func_0x00400ca0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c40(lVar1); } return; }
['gcc']