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 |
|---|---|---|---|---|---|---|---|---|
10,800 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53b_goodB2GSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116834/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53b_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53b_goodB2GSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,801 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_badSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_badSink(data);
} | [] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116834/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_badSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_badSink(param_1);
return;
}
| ['gcc'] |
10,802 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_goodB2GSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116834/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53c_goodB2GSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,803 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_badSink(FILE * data)
{
/* FLAW: No attempt to close the file */
; /* empty statement needed for some flow variants */
} | ['/* FLAW: No attempt to close the file */', '/* empty statement needed for some flow variants */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116834/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_badSink(void)
{
return;
}
| ['gcc'] |
10,804 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_goodB2GSink(FILE * data)
{
/* FIX: If the file is still opened, close it */
if (data != NULL)
{
fclose(data);
}
} | ['/* FIX: If the file is still opened, close it */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116834/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_53d_goodB2GSink
(long param_1)
{
if (param_1 != 0) {
func_0x00400a40(param_1);
}
return;
}
| ['gcc'] |
10,805 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54_bad()
{
FILE * data;
data = NULL;
/* POTENTIAL FLAW: Open a file without closing it */
data = fopen("BadSource_fopen.txt", "w+");
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_badSink(data);
} | ['/* POTENTIAL FLAW: Open a file without closing it */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54_bad |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54_bad(void)
{
undefined8 uVar1;
uVar1 = func_0x00400a80(&UNK_00401197,&UNK_00401194);
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_badSink(uVar1);
return;
}
| ['gcc'] |
10,806 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54_good |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,807 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_badSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_badSink(data);
} | [] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_badSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_badSink(param_1);
return;
}
| ['gcc'] |
10,808 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_goodB2GSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54b_goodB2GSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,809 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_badSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_badSink(data);
} | [] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_badSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_badSink(param_1);
return;
}
| ['gcc'] |
10,810 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_goodB2GSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54c_goodB2GSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,811 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_badSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_badSink(data);
} | [] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_badSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_badSink(param_1);
return;
}
| ['gcc'] |
10,812 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_goodB2GSink(FILE * data)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54d_goodB2GSink
(undefined8 param_1)
{
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,813 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_badSink(FILE * data)
{
/* FLAW: No attempt to close the file */
; /* empty statement needed for some flow variants */
} | ['/* FLAW: No attempt to close the file */', '/* empty statement needed for some flow variants */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_badSink(void)
{
return;
}
| ['gcc'] |
10,814 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_goodB2GSink(FILE * data)
{
/* FIX: If the file is still opened, close it */
if (data != NULL)
{
fclose(data);
}
} | ['/* FIX: If the file is still opened, close it */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116835/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_54e_goodB2GSink
(long param_1)
{
if (param_1 != 0) {
func_0x00400a40(param_1);
}
return;
}
| ['gcc'] |
10,815 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64_bad()
{
FILE * data;
data = NULL;
/* POTENTIAL FLAW: Open a file without closing it */
data = fopen("BadSource_fopen.txt", "w+");
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_badSink(&data);
} | ['/* POTENTIAL FLAW: Open a file without closing it */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116839/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64_bad |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64_bad(void)
{
undefined8 uStack_10;
uStack_10 = 0;
uStack_10 = func_0x00400a80(&UNK_00401157,&UNK_00401154);
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_badSink(&uStack_10);
return;
}
| ['gcc'] |
10,816 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116839/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64_good |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,817 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
FILE * * dataPtr = (FILE * *)dataVoidPtr;
/* dereference dataPtr into data */
FILE * data = (*dataPtr);
/* FLAW: No attempt to close the file */
; /* empty statement needed for some flow variants */
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FLAW: No attempt to close the file */', '/* empty statement needed for some flow variants */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116839/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_badSink(void)
{
return;
}
| ['gcc'] |
10,818 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_goodB2GSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
FILE * * dataPtr = (FILE * *)dataVoidPtr;
/* dereference dataPtr into data */
FILE * data = (*dataPtr);
/* FIX: If the file is still opened, close it */
if (data != NULL)
{
fclose(data);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FIX: If the file is still opened, close it */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116839/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_64b_goodB2GSink
(long *param_1)
{
if (*param_1 != 0) {
func_0x00400a40(*param_1);
}
return;
}
| ['gcc'] |
10,819 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66_bad()
{
FILE * data;
FILE * dataArray[5];
data = NULL;
/* POTENTIAL FLAW: Open a file without closing it */
data = fopen("BadSource_fopen.txt", "w+");
/* put data in array */
dataArray[2] = data;
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_badSink(dataArray);
} | ['/* POTENTIAL FLAW: Open a file without closing it */', '/* put data in array */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116841/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66_bad |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66_bad(void)
{
undefined auStack_38 [16];
undefined8 uStack_28;
undefined8 uStack_10;
uStack_10 = 0;
uStack_28 = func_0x00400a80(&UNK_00401157,&UNK_00401154);
uStack_10 = uStack_28;
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_badSink(auStack_38);
return;
}
| ['gcc'] |
10,820 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116841/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66_good |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,821 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_badSink(FILE * dataArray[])
{
/* copy data out of dataArray */
FILE * data = dataArray[2];
/* FLAW: No attempt to close the file */
; /* empty statement needed for some flow variants */
} | ['/* copy data out of dataArray */', '/* FLAW: No attempt to close the file */', '/* empty statement needed for some flow variants */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116841/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_badSink(void)
{
return;
}
| ['gcc'] |
10,822 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_goodB2GSink(FILE * dataArray[])
{
FILE * data = dataArray[2];
/* FIX: If the file is still opened, close it */
if (data != NULL)
{
fclose(data);
}
} | ['/* FIX: If the file is still opened, close it */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116841/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_66b_goodB2GSink
(long param_1)
{
if (*(long *)(param_1 + 0x10) != 0) {
func_0x00400a40(*(long *)(param_1 + 0x10));
}
return;
}
| ['gcc'] |
10,823 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_bad()
{
FILE * data;
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_structType myStruct;
data = NULL;
/* POTENTIAL FLAW: Open a file without closing it */
data = fopen("BadSource_fopen.txt", "w+");
myStruct.structFirst = data;
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_badSink(myStruct);
} | ['/* POTENTIAL FLAW: Open a file without closing it */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116842/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_bad |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_bad(void)
{
undefined8 uVar1;
uVar1 = func_0x00400a80(&UNK_00401157,&UNK_00401154);
CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_badSink(uVar1);
return;
}
| ['gcc'] |
10,824 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116842/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67a.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_good |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,825 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_badSink(CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_structType myStruct)
{
FILE * data = myStruct.structFirst;
/* FLAW: No attempt to close the file */
; /* empty statement needed for some flow variants */
} | ['/* FLAW: No attempt to close the file */', '/* empty statement needed for some flow variants */'] | ['CWE775'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116842/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_badSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_badSink(void)
{
return;
}
| ['gcc'] |
10,826 | void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_goodB2GSink(CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67_structType myStruct)
{
FILE * data = myStruct.structFirst;
/* FIX: If the file is still opened, close it */
if (data != NULL)
{
fclose(data);
}
} | ['/* FIX: If the file is still opened, close it */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116842/CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b.c | CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_goodB2GSink |
void CWE775_Missing_Release_of_File_Descriptor_or_Handle__fopen_no_close_67b_goodB2GSink
(long param_1)
{
if (param_1 != 0) {
func_0x00400a40(param_1);
}
return;
}
| ['gcc'] |
10,827 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116983/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401528);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401538);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,828 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116983/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_01_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,829 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(1)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116984/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401528);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401538);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,830 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116984/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_02_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,831 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(5==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(5==5)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116985/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401528);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401538);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,832 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116985/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_03_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,833 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(STATIC_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(STATIC_CONST_TRUE)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116986/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401550);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401560);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,834 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116986/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_04_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,835 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(staticTrue)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116987/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
if (staticTrue != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
if (staticTrue != 0) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,836 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116987/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_05_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,837 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(STATIC_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(STATIC_CONST_FIVE==5)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116988/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_0040154c);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,838 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116988/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,839 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(staticFive==5)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116989/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
if (staticFive == 5) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
if (staticFive == 5) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,840 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116989/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,841 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(staticReturnsTrue())
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116990/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401568);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
if (uStack_10 < 6) {
printLine(&UNK_00401578);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,842 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116990/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,843 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(GLOBAL_CONST_TRUE)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116991/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
if (GLOBAL_CONST_TRUE != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
if (GLOBAL_CONST_TRUE != 0) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,844 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116991/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,845 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(globalTrue)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116992/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
if (globalTrue != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
if (globalTrue != 0) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,846 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116992/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,847 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(globalReturnsTrue())
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116993/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,848 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116993/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_11_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,849 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalReturnsTrueOrFalse())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
else
{
/* FIX: Use a relatively small number for memory allocation */
data = 20;
}
if(globalReturnsTrueOrFalse())
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
else
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* FIX: Use a relatively small number for memory allocation */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116994/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_28;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_10 = 0x14;
}
else {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_004015a8);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
if ((uStack_10 < 6) || (99 < uStack_10)) {
printLine(&UNK_004015f0);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
else if (uStack_10 < 6) {
printLine(&UNK_004015b8);
}
else {
puStack_28 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_28 = 0x6c6c6568;
*(undefined2 *)(puStack_28 + 1) = 0x6f;
printLine(puStack_28);
func_0x00400c40(puStack_28);
}
return;
}
| ['gcc'] |
10,850 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116994/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_12_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
10,851 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(GLOBAL_CONST_FIVE==5)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116995/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
if (GLOBAL_CONST_FIVE == 5) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
if (GLOBAL_CONST_FIVE == 5) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,852 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116995/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_13_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,853 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(globalFive==5)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116996/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
if (globalFive == 5) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401548);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
if (globalFive == 5) {
if (uStack_10 < 6) {
printLine(&UNK_00401558);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,854 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116996/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_14_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,855 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15_bad()
{
size_t data;
/* Initialize data */
data = 0;
switch(6)
{
case 6:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
switch(7)
{
case 7:
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116997/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401528);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401538);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,856 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116997/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_15_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
10,857 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16_bad()
{
size_t data;
/* Initialize data */
data = 0;
while(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
break;
}
while(1)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116998/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401528);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401538);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,858 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116998/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_16_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
10,859 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17_bad()
{
int i,j;
size_t data;
/* Initialize data */
data = 0;
for(i = 0; i < 1; i++)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
for(j = 0; j < 1; j++)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116999/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_28;
int iStack_24;
undefined4 *puStack_20;
ulong uStack_18;
int iStack_10;
int iStack_c;
uStack_18 = 0;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
iStack_24 = 0xffffffff;
iStack_24 = func_0x00400d90(2,1,6);
if (iStack_24 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401558);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_24,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_28 = func_0x00400c50(iStack_24,auStack_58,0x19,0), iStack_28 != -1)) &&
(iStack_28 != 0)) {
auStack_58[iStack_28] = 0;
uStack_18 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_24 != -1) {
func_0x00400cb0(iStack_24);
}
}
for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) {
if (uStack_18 < 6) {
printLine(&UNK_00401568);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_18);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
}
return;
}
| ['gcc'] |
10,860 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/116999/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_17_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
10,861 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18_bad()
{
size_t data;
/* Initialize data */
data = 0;
goto source;
source:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
goto sink;
sink:
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117000/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_00401528);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_58[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
if (uStack_10 < 6) {
printLine(&UNK_00401538);
}
else {
puStack_20 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_20 = 0x6c6c6568;
*(undefined2 *)(puStack_20 + 1) = 0x6f;
printLine(puStack_20);
func_0x00400c40(puStack_20);
}
return;
}
| ['gcc'] |
10,862 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117000/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_18_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
10,863 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
badStatic = 1; /* true */
badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* true */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117001/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_0040158b);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
badStatic = 1;
badSink(uStack_10);
return;
}
| ['gcc'] |
10,864 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21_good()
{
goodB2G1();
goodB2G2();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117001/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_21_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
| ['gcc'] |
10,865 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badGlobal = 1; /* true */
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* true */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117002/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_00401554);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badGlobal = 1;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badSink(uStack_10);
return;
}
| ['gcc'] |
10,866 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_good()
{
goodB2G1();
goodB2G2();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117002/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
| ['gcc'] |
10,867 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badSink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badGlobal)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117002/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badSink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_badGlobal != 0) {
if (param_1 < 6) {
printLine(&UNK_00401558);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
}
return;
}
| ['gcc'] |
10,868 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G1Sink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117002/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G1Sink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G1Sink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G1Global == 0) {
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_004017b0);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
}
else {
printLine(&UNK_00401798);
}
return;
}
| ['gcc'] |
10,869 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G2Sink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G2Global)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117002/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G2Sink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G2Sink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodB2G2Global != 0) {
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_004017b0);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
}
return;
}
| ['gcc'] |
10,870 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodG2BSink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodG2BGlobal)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117002/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_22_goodG2BGlobal != 0) {
if (param_1 < 6) {
printLine(&UNK_004017f0);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
}
return;
}
| ['gcc'] |
10,871 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
size_t dataCopy = data;
size_t data = dataCopy;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117003/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31_bad(void)
{
int iVar1;
undefined auStack_68 [32];
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
ulong uStack_28;
ulong uStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400cf0(&UNK_00401538);
uStack_46 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_68,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_68[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_68,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
uStack_20 = uStack_10;
uStack_28 = uStack_10;
if (uStack_10 < 6) {
printLine(&UNK_00401548);
}
else {
puStack_30 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_30 = 0x6c6c6568;
*(undefined2 *)(puStack_30 + 1) = 0x6f;
printLine(puStack_30);
func_0x00400c40(puStack_30);
}
return;
}
| ['gcc'] |
10,872 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117003/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_31_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,873 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32_bad()
{
size_t data;
size_t *dataPtr1 = &data;
size_t *dataPtr2 = &data;
/* Initialize data */
data = 0;
{
size_t data = *dataPtr1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
*dataPtr1 = data;
}
{
size_t data = *dataPtr2;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117004/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32_bad |
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32_bad(void)
{
int iVar1;
undefined auStack_78 [32];
undefined2 uStack_58;
undefined2 uStack_56;
undefined4 uStack_54;
ulong uStack_40;
undefined4 *puStack_38;
ulong uStack_30;
int iStack_28;
int iStack_24;
ulong *puStack_20;
ulong *puStack_18;
ulong uStack_10;
puStack_18 = &uStack_40;
puStack_20 = &uStack_40;
uStack_40 = 0;
uStack_10 = 0;
iStack_24 = 0xffffffff;
iStack_24 = func_0x00400d90(2,1,6);
if (iStack_24 != -1) {
func_0x00400ca0(&uStack_58,0,0x10);
uStack_58 = 2;
uStack_54 = func_0x00400cf0(&UNK_00401558);
uStack_56 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_24,&uStack_58,0x10);
if (((iVar1 != -1) &&
(iStack_28 = func_0x00400c50(iStack_24,auStack_78,0x19,0), iStack_28 != -1)) &&
(iStack_28 != 0)) {
auStack_78[iStack_28] = 0;
uStack_10 = func_0x00400d50(auStack_78,0,0);
}
}
if (iStack_24 != -1) {
func_0x00400cb0(iStack_24);
}
*puStack_18 = uStack_10;
uStack_30 = *puStack_20;
if (uStack_30 < 6) {
printLine(&UNK_00401568);
}
else {
puStack_38 = (undefined4 *)func_0x00400d20(uStack_30);
*puStack_38 = 0x6c6c6568;
*(undefined2 *)(puStack_38 + 1) = 0x6f;
printLine(puStack_38);
func_0x00400c40(puStack_38);
}
return;
}
| ['gcc'] |
10,874 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117004/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_32_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,875 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_bad()
{
size_t data;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_unionType myUnion;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myUnion.unionFirst = data;
{
size_t data = myUnion.unionSecond;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117006/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_bad(void)
{
int iVar1;
undefined auStack_68 [32];
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
ulong uStack_30;
undefined4 *puStack_28;
ulong uStack_20;
int iStack_18;
int iStack_14;
ulong uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400cf0(&UNK_00401538);
uStack_46 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_68,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_68[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_68,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
uStack_30 = uStack_10;
uStack_20 = uStack_10;
if (uStack_10 < 6) {
printLine(&UNK_00401548);
}
else {
puStack_28 = (undefined4 *)func_0x00400d20(uStack_10);
*puStack_28 = 0x6c6c6568;
*(undefined2 *)(puStack_28 + 1) = 0x6f;
printLine(puStack_28);
func_0x00400c40(puStack_28);
}
return;
}
| ['gcc'] |
10,876 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117006/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_34_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,877 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117007/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_0040157b);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
badSink(uStack_10);
return;
}
| ['gcc'] |
10,878 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117007/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_41_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
10,879 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42_bad()
{
size_t data;
/* Initialize data */
data = 0;
data = badSource(data);
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117008/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42_bad(void)
{
ulong uVar1;
undefined4 *puVar2;
uVar1 = badSource(0);
if (uVar1 < 6) {
printLine(&UNK_00401558);
}
else {
puVar2 = (undefined4 *)func_0x00400d20(uVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400c40(puVar2);
}
return;
}
| ['gcc'] |
10,880 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117008/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_42_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
10,881 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44_bad()
{
size_t data;
/* define a function pointer */
void (*funcPtr) (size_t) = badSink;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* use the function pointer */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117010/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_20;
int iStack_1c;
code *pcStack_18;
undefined8 uStack_10;
pcStack_18 = badSink;
uStack_10 = 0;
iStack_1c = 0xffffffff;
iStack_1c = func_0x00400d90(2,1,6);
if (iStack_1c != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cf0(&UNK_0040158b);
uStack_36 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_20 = func_0x00400c50(iStack_1c,auStack_58,0x19,0), iStack_20 != -1)) &&
(iStack_20 != 0)) {
auStack_58[iStack_20] = 0;
uStack_10 = func_0x00400d50(auStack_58,0,0);
}
}
if (iStack_1c != -1) {
func_0x00400cb0(iStack_1c);
}
(*pcStack_18)(uStack_10);
return;
}
| ['gcc'] |
10,882 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117010/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_44_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,883 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_badData = data;
badSink();
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117011/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_0040158b);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_badData = uStack_10;
badSink();
return;
}
| ['gcc'] |
10,884 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117011/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_45_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,885 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117012/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_00401544);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_badSink(uStack_10);
return;
}
| ['gcc'] |
10,886 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117012/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,887 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_badSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117012/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_badSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_00401548);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
return;
}
| ['gcc'] |
10,888 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_goodG2BSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117012/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_004015e8);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
return;
}
| ['gcc'] |
10,889 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_goodB2GSink(size_t data)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117012/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_51b_goodB2GSink(ulong param_1)
{
undefined4 *puVar1;
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_00401620);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
return;
}
| ['gcc'] |
10,890 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_00401564);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_badSink(uStack_10);
return;
}
| ['gcc'] |
10,891 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
10,892 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_badSink(param_1);
return;
}
| ['gcc'] |
10,893 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
10,894 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52b_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,895 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_badSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_badSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_00401568);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
return;
}
| ['gcc'] |
10,896 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodG2BSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_00401628);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
return;
}
| ['gcc'] |
10,897 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodB2GSink(size_t data)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117013/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_52c_goodB2GSink(ulong param_1)
{
undefined4 *puVar1;
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_00401660);
}
else {
puVar1 = (undefined4 *)func_0x00400d20(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c40(puVar1);
}
return;
}
| ['gcc'] |
10,898 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53_bad()
{
size_t data;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to unsigned int */
data = strtoul(inputBuffer, NULL, 0);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53_bad(void)
{
int iVar1;
undefined auStack_48 [32];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cf0(&UNK_00401574);
uStack_26 = func_0x00400c80(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_48[iStack_18] = 0;
uStack_10 = func_0x00400d50(auStack_48,0,0);
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_badSink(uStack_10);
return;
}
| ['gcc'] |
10,899 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.