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 |
|---|---|---|---|---|---|---|---|---|
47,900 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17_bad()
{
int i;
short data;
/* Initialize data */
data = 0;
for(i = 0; i < 1; i++)
{
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &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 */', '/* FLAW: Use a value input from the console using fscanf() */', '/* 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/86830/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17_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_e;
int iStack_c;
sStack_e = 0;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
func_0x00400ab0(stdin,&UNK_004012e4,&sStack_e);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_e < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_e);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_e) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,901 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86830/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_17_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,902 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18_bad()
{
short data;
/* Initialize data */
data = 0;
goto source;
source:
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &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 */', '/* FLAW: Use a value input from the console using fscanf() */', '/* 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/86831/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18_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;
func_0x00400ab0(stdin,&UNK_004012d4,&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;
func_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,903 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86831/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_18_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,904 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21_bad()
{
short data;
/* Initialize data */
data = 0;
badStatic = 1; /* true */
data = 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 */', '/* true */', '/* 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/86832/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21_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;
badStatic = 1;
sStack_a = 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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,905 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86832/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_21_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,906 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_bad()
{
short data;
/* Initialize data */
data = 0;
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badGlobal = 1; /* true */
data = CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_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 */', '/* true */', '/* 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/86833/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_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;
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badGlobal = 1;
sStack_a = CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,907 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86833/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,908 | short CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badSource(short data)
{
if(CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badGlobal)
{
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
}
return data;
} | ['/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86833/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badSource |
undefined2 CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badSource(undefined2 param_1)
{
undefined2 auStack_c [2];
auStack_c[0] = param_1;
if (CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_badGlobal != 0) {
func_0x00400ab0(stdin,&UNK_00401304,auStack_c);
}
return auStack_c[0];
}
| ['gcc'] |
47,909 | short CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B1Source(short data)
{
if(CWE194_Unexpected_Sign_Extension__fscanf_strncpy_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/86833/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B1Source |
undefined2 CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B1Source(undefined2 param_1)
{
undefined2 uStack_c;
if (CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B1Global == 0) {
uStack_c = 99;
}
else {
printLine(&UNK_00401394);
uStack_c = param_1;
}
return uStack_c;
}
| ['gcc'] |
47,910 | short CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B2Source(short data)
{
if(CWE194_Unexpected_Sign_Extension__fscanf_strncpy_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/86833/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B2Source |
undefined2 CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B2Source(undefined2 param_1)
{
undefined2 uStack_c;
uStack_c = param_1;
if (CWE194_Unexpected_Sign_Extension__fscanf_strncpy_22_goodG2B2Global != 0) {
uStack_c = 99;
}
return uStack_c;
}
| ['gcc'] |
47,911 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
{
short dataCopy = data;
short data = dataCopy;
{
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 */', '/* FLAW: Use a value input from the console using fscanf() */', '/* 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/86834/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31_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_e;
short sStack_c;
short sStack_a;
sStack_e = 0;
func_0x00400ab0(stdin,&UNK_004012e4,&sStack_e);
sStack_a = sStack_e;
sStack_c = sStack_e;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_c < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_c);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,912 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86834/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_31_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,913 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32_bad()
{
short data;
short *dataPtr1 = &data;
short *dataPtr2 = &data;
/* Initialize data */
data = 0;
{
short data = *dataPtr1;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
*dataPtr1 = data;
}
{
short data = *dataPtr2;
{
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 */', '/* FLAW: Use a value input from the console using fscanf() */', '/* 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/86835/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32_bad |
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32_bad(void)
{
undefined auStack_f8 [99];
undefined uStack_95;
undefined8 uStack_88;
undefined8 uStack_80;
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;
undefined4 uStack_28;
short sStack_1e;
short sStack_1c;
short sStack_1a;
short *psStack_18;
short *psStack_10;
psStack_10 = &sStack_1c;
psStack_18 = &sStack_1c;
sStack_1c = 0;
sStack_1e = 0;
func_0x00400ab0(stdin,&UNK_00401304,&sStack_1e);
*psStack_10 = sStack_1e;
sStack_1a = *psStack_18;
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
func_0x00400af0(auStack_f8,0x41,99);
uStack_95 = 0;
if (sStack_1a < 100) {
func_0x00400aa0(&uStack_88,auStack_f8,(long)sStack_1a);
*(undefined *)((long)&uStack_88 + (long)(int)sStack_1a) = 0;
}
printLine(&uStack_88);
return;
}
| ['gcc'] |
47,914 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86835/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_32_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,915 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_bad()
{
short data;
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_unionType myUnion;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
myUnion.unionFirst = data;
{
short data = myUnion.unionSecond;
{
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 */', '/* FLAW: Use a value input from the console using fscanf() */', '/* 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/86837/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_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_e;
short sStack_c;
short sStack_a;
sStack_c = 0;
func_0x00400ab0(stdin,&UNK_004012e4,&sStack_c);
sStack_e = sStack_c;
sStack_a = sStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,916 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86837/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_34_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,917 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_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/86838/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,918 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86838/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_bad(void)
{
short sStack_a;
sStack_a = 0;
func_0x00400ab0(stdin,&UNK_004012f4,&sStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,919 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_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/86838/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_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'] |
47,920 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86838/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_41_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,921 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42_bad()
{
short data;
/* Initialize data */
data = 0;
data = 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/86839/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42_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 = 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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,922 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86839/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_42_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,923 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44_bad()
{
short data;
/* define a function pointer */
void (*funcPtr) (short) = badSink;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */', '/* use the function pointer */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86841/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44_bad(void)
{
short sStack_12;
code *pcStack_10;
pcStack_10 = badSink;
sStack_12 = 0;
func_0x00400ab0(stdin,&UNK_00401304,&sStack_12);
(*pcStack_10)((int)sStack_12);
return;
}
| ['gcc'] |
47,924 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86841/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_44_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,925 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_badData = data;
badSink();
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86842/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_bad(void)
{
undefined2 uStack_a;
uStack_a = 0;
func_0x00400ab0(stdin,&UNK_004012f4,&uStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_badData = uStack_a;
badSink();
return;
}
| ['gcc'] |
47,926 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86842/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_45_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,927 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86843/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51_bad(void)
{
short sStack_a;
sStack_a = 0;
func_0x00400ab0(stdin,&UNK_004012f4,&sStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,928 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86843/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,929 | void CWE194_Unexpected_Sign_Extension__fscanf_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/86843/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51b_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,930 | void CWE194_Unexpected_Sign_Extension__fscanf_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/86843/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_51b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_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'] |
47,931 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86844/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52_bad(void)
{
short sStack_a;
sStack_a = 0;
func_0x00400ab0(stdin,&UNK_00401314,&sStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,932 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86844/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,933 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86844/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_badSink((int)param_1);
return;
}
| ['gcc'] |
47,934 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86844/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52b_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,935 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_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/86844/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,936 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_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/86844/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_52c_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'] |
47,937 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53_bad(void)
{
short sStack_a;
sStack_a = 0;
func_0x00400ab0(stdin,&UNK_00401334,&sStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,938 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,939 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_badSink((int)param_1);
return;
}
| ['gcc'] |
47,940 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53b_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,941 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d_badSink((int)param_1);
return;
}
| ['gcc'] |
47,942 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53c_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,943 | void CWE194_Unexpected_Sign_Extension__fscanf_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/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,944 | void CWE194_Unexpected_Sign_Extension__fscanf_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/86845/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_53d_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_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'] |
47,945 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_badSink(data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54_bad(void)
{
short sStack_a;
sStack_a = 0;
func_0x00400ab0(stdin,&UNK_00401344,&sStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_badSink((int)sStack_a);
return;
}
| ['gcc'] |
47,946 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,947 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_badSink((int)param_1);
return;
}
| ['gcc'] |
47,948 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54b_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,949 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_badSink((int)param_1);
return;
}
| ['gcc'] |
47,950 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54c_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,951 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_badSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_badSink(data);
} | [] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_badSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_badSink((int)param_1);
return;
}
| ['gcc'] |
47,952 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_goodG2BSink(short data)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54d_goodG2BSink(short param_1)
{
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_goodG2BSink((int)param_1);
return;
}
| ['gcc'] |
47,953 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_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/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,954 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_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/86846/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_54e_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'] |
47,955 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61_bad()
{
short data;
/* Initialize data */
data = 0;
data = CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b_badSource(data);
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign 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/86847/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61_bad(void)
{
undefined auStack_e8 [99];
undefined uStack_85;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
short sStack_a;
sStack_a = 0;
sStack_a = CWE194_Unexpected_Sign_Extension__fscanf_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,956 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86847/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,957 | short CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b_badSource(short data)
{
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
return data;
} | ['/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86847/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b_badSource |
undefined2 CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b_badSource(undefined2 param_1)
{
undefined2 auStack_c [2];
auStack_c[0] = param_1;
func_0x00400ab0(stdin,&UNK_004012f4,auStack_c);
return auStack_c[0];
}
| ['gcc'] |
47,958 | short CWE194_Unexpected_Sign_Extension__fscanf_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/86847/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b_goodG2BSource |
undefined2 CWE194_Unexpected_Sign_Extension__fscanf_strncpy_61b_goodG2BSource(void)
{
return 99;
}
| ['gcc'] |
47,959 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63_bad()
{
short data;
/* Initialize data */
data = 0;
/* FLAW: Use a value input from the console using fscanf() */
fscanf (stdin, "%hd", &data);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63b_badSink(&data);
} | ['/* Initialize data */', '/* FLAW: Use a value input from the console using fscanf() */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86849/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63_bad |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63_bad(void)
{
undefined2 uStack_a;
uStack_a = 0;
func_0x00400ab0(stdin,&UNK_004012f4,&uStack_a);
CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63b_badSink(&uStack_a);
return;
}
| ['gcc'] |
47,960 | void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86849/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63a.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63_good |
void CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,961 | void CWE194_Unexpected_Sign_Extension__fscanf_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/86849/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63b_badSink |
void CWE194_Unexpected_Sign_Extension__fscanf_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_0x00400af0(auStack_e8,0x41,99);
uStack_85 = 0;
if (sStack_a < 100) {
func_0x00400aa0(&uStack_78,auStack_e8,(long)sStack_a);
*(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
47,962 | void CWE194_Unexpected_Sign_Extension__fscanf_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/86849/CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63b.c | CWE194_Unexpected_Sign_Extension__fscanf_strncpy_63b_goodG2BSink |
void CWE194_Unexpected_Sign_Extension__fscanf_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'] |
47,963 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01_bad()
{
short data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86862/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,964 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86862/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_01_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,965 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02_bad()
{
short data;
/* Initialize data */
data = 0;
if(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86863/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,966 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86863/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_02_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,967 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03_bad()
{
short data;
/* Initialize data */
data = 0;
if(5==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86864/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,968 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86864/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_03_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,969 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04_bad()
{
short data;
/* Initialize data */
data = 0;
if(STATIC_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86865/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,970 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86865/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_04_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,971 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_bad()
{
short data;
/* Initialize data */
data = 0;
if(staticTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86866/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
if (staticTrue != 0) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,972 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86866/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_05_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,973 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06_bad()
{
short data;
/* Initialize data */
data = 0;
if(STATIC_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86867/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,974 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86867/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_06_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,975 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07_bad()
{
short data;
/* Initialize data */
data = 0;
if(staticFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86868/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
if (staticFive == 5) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,976 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86868/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_07_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,977 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08_bad()
{
short data;
/* Initialize data */
data = 0;
if(staticReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86869/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,978 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86869/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_08_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,979 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09_bad()
{
short data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86870/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
if (GLOBAL_CONST_TRUE != 0) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,980 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86870/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_09_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,981 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86871/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
if (globalTrue != 0) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,982 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86871/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_10_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,983 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86872/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,984 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86872/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_11_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,985 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalReturnsTrueOrFalse())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#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 */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86873/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
sStack_a = 99;
}
else {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,986 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86873/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_12_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,987 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_bad()
{
short data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86874/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
if (GLOBAL_CONST_FIVE == 5) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,988 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86874/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_13_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,989 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_bad()
{
short data;
/* Initialize data */
data = 0;
if(globalFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86875/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
if (globalFive == 5) {
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,990 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86875/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_14_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,991 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15_bad()
{
short data;
/* Initialize data */
data = 0;
switch(6)
{
case 6:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#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 */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86876/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,992 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86876/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_15_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
47,993 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16_bad()
{
short data;
/* Initialize data */
data = 0;
while(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#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 */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86877/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,994 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86877/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_16_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,995 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17_bad()
{
int i;
short data;
/* Initialize data */
data = 0;
for(i = 0; i < 1; i++)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86878/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17_bad(void)
{
int iVar1;
undefined auStack_50 [8];
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
int iStack_2c;
int iStack_28;
int iStack_24;
long lStack_20;
int iStack_14;
short sStack_e;
int iStack_c;
sStack_e = 0;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
iStack_24 = 0xffffffff;
iStack_14 = -1;
iStack_24 = func_0x00400dd0(2,1,6);
if (iStack_24 != -1) {
func_0x00400cd0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = 0;
uStack_46 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_24,&uStack_48,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_24,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400d90(iStack_24,0,0), iStack_14 != -1)) &&
((iStack_28 = func_0x00400c80(iStack_14,auStack_50,7,0), iStack_28 != -1 &&
(iStack_28 != 0)))) {
auStack_50[iStack_28] = 0;
iStack_2c = func_0x00400da0(auStack_50);
if ((iStack_2c < 0x8000) && (-0x8001 < iStack_2c)) {
sStack_e = (short)iStack_2c;
}
else {
sStack_e = -1;
}
}
}
if (iStack_24 != -1) {
func_0x00400ce0(iStack_24);
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
}
if (sStack_e < 100) {
lStack_20 = func_0x00400d40((long)sStack_e);
func_0x00400cd0(lStack_20,0x41,(long)(sStack_e + -1));
*(undefined *)(lStack_20 + (long)sStack_e + -1) = 0;
printLine(lStack_20);
func_0x00400c70(lStack_20);
}
return;
}
| ['gcc'] |
47,996 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86878/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_17_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,997 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18_bad()
{
short data;
/* Initialize data */
data = 0;
goto source;
source:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
int tempInt;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
/* FLAW: Use a value input from the network */
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate string */
inputBuffer[recvResult] = '\0';
/* Convert to short - ensure int to short conversion will be successful and if
* not ensure that data will be negative */
tempInt = atoi(inputBuffer);
if (tempInt > SHRT_MAX || tempInt < SHRT_MIN)
{
data = -1;
}
else
{
data = tempInt;
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* 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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86879/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18_bad(void)
{
int iVar1;
undefined auStack_40 [8];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
long lStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
short sStack_a;
sStack_a = 0;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400dd0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c80(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0))
)) {
auStack_40[iStack_18] = 0;
iStack_1c = func_0x00400da0(auStack_40);
if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) {
sStack_a = (short)iStack_1c;
}
else {
sStack_a = -1;
}
}
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (sStack_a < 100) {
lStack_28 = func_0x00400d40((long)sStack_a);
func_0x00400cd0(lStack_28,0x41,(long)(sStack_a + -1));
*(undefined *)(lStack_28 + (long)sStack_a + -1) = 0;
printLine(lStack_28);
func_0x00400c70(lStack_28);
}
return;
}
| ['gcc'] |
47,998 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86879/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18_good |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_18_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
47,999 | void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_21_bad()
{
short data;
/* Initialize data */
data = 0;
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 */'] | ['CWE194'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86880/CWE194_Unexpected_Sign_Extension__listen_socket_malloc_21.c | CWE194_Unexpected_Sign_Extension__listen_socket_malloc_21_bad |
void CWE194_Unexpected_Sign_Extension__listen_socket_malloc_21_bad(void)
{
short sVar1;
long lVar2;
badStatic = 1;
sVar1 = badSource(0);
if (sVar1 < 100) {
lVar2 = func_0x00400d40((long)sVar1);
func_0x00400cd0(lVar2,0x41,(long)(sVar1 + -1));
*(undefined *)(lVar2 + (long)sVar1 + -1) = 0;
printLine(lVar2);
func_0x00400c70(lVar2);
}
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.