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
11,400
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53_bad() { size_t data; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53_bad(void) { int iVar1; iVar1 = func_0x00400ae0(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_badSink((long)iVar1); return; }
['gcc']
11,401
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,402
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_badSink(param_1); return; }
['gcc']
11,403
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodG2BSink(param_1); return; }
['gcc']
11,404
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53b_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodB2GSink(param_1); return; }
['gcc']
11,405
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_badSink(param_1); return; }
['gcc']
11,406
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodG2BSink(param_1); return; }
['gcc']
11,407
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53c_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodB2GSink(param_1); return; }
['gcc']
11,408
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_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/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401208); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,409
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_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/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_004012e8); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,410
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_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/117206/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_53d_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401320); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,411
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54_bad() { size_t data; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54_bad(void) { int iVar1; iVar1 = func_0x00400ae0(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_badSink((long)iVar1); return; }
['gcc']
11,412
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,413
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_badSink(param_1); return; }
['gcc']
11,414
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodG2BSink(param_1); return; }
['gcc']
11,415
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54b_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodB2GSink(param_1); return; }
['gcc']
11,416
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_badSink(param_1); return; }
['gcc']
11,417
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodG2BSink(param_1); return; }
['gcc']
11,418
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54c_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodB2GSink(param_1); return; }
['gcc']
11,419
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_badSink(param_1); return; }
['gcc']
11,420
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodG2BSink(param_1); return; }
['gcc']
11,421
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54d_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodB2GSink(param_1); return; }
['gcc']
11,422
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_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/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401228); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,423
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_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/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401318); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,424
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_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/117207/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_54e_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401350); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,425
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61_bad() { size_t data; /* Initialize data */ data = 0; data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_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/117208/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61_bad(void) { ulong uVar1; undefined4 *puVar2; uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_badSource(0); if (uVar1 < 6) { printLine(&UNK_004011d8); } else { puVar2 = (undefined4 *)func_0x00400ab0(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400a20(puVar2); } return; }
['gcc']
11,426
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117208/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,427
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_badSource(size_t data) { /* POTENTIAL FLAW: Set data to a random value */ data = rand(); return data; }
['/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117208/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_badSource
long CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_badSource(void) { int iVar1; iVar1 = func_0x00400ae0(); return (long)iVar1; }
['gcc']
11,428
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_goodG2BSource(size_t data) { /* FIX: Use a relatively small number for memory allocation */ data = 20; return data; }
['/* FIX: Use a relatively small number for memory allocation */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117208/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_goodG2BSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_goodG2BSource(void) { return 0x14; }
['gcc']
11,429
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_goodB2GSource(size_t data) { /* POTENTIAL FLAW: Set data to a random value */ data = rand(); return data; }
['/* POTENTIAL FLAW: Set data to a random value */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117208/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_goodB2GSource
long CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_61b_goodB2GSource(void) { int iVar1; iVar1 = func_0x00400ae0(); return (long)iVar1; }
['gcc']
11,430
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63_bad() { size_t data; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117210/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63_bad(void) { int iVar1; long lStack_10; lStack_10 = 0; iVar1 = func_0x00400ae0(); lStack_10 = (long)iVar1; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_badSink(&lStack_10); return; }
['gcc']
11,431
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117210/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,432
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_badSink(size_t * dataPtr) { size_t data = *dataPtr; { 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/117210/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_badSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_004011e8); } else { puVar1 = (undefined4 *)func_0x00400ab0(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,433
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_goodG2BSink(size_t * dataPtr) { size_t data = *dataPtr; { 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/117210/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_goodG2BSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_00401298); } else { puVar1 = (undefined4 *)func_0x00400ab0(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,434
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_goodB2GSink(size_t * dataPtr) { size_t data = *dataPtr; { 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/117210/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_63b_goodB2GSink(ulong *param_1) { ulong uVar1; undefined4 *puVar2; uVar1 = *param_1; if ((uVar1 < 6) || (99 < uVar1)) { printLine(&UNK_004012d0); } else { puVar2 = (undefined4 *)func_0x00400ab0(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400a20(puVar2); } return; }
['gcc']
11,435
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64_bad() { size_t data; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117211/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64_bad(void) { int iVar1; long lStack_10; lStack_10 = 0; iVar1 = func_0x00400ae0(); lStack_10 = (long)iVar1; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_badSink(&lStack_10); return; }
['gcc']
11,436
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117211/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,437
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ size_t * dataPtr = (size_t *)dataVoidPtr; /* dereference dataPtr into data */ size_t data = (*dataPtr); { 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"); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into 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/117211/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_badSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_004011e8); } else { puVar1 = (undefined4 *)func_0x00400ab0(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,438
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ size_t * dataPtr = (size_t *)dataVoidPtr; /* dereference dataPtr into data */ size_t data = (*dataPtr); { 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"); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into 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 */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117211/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_goodG2BSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_004012a8); } else { puVar1 = (undefined4 *)func_0x00400ab0(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,439
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_goodB2GSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ size_t * dataPtr = (size_t *)dataVoidPtr; /* dereference dataPtr into data */ size_t data = (*dataPtr); { 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"); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* 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/117211/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_64b_goodB2GSink(ulong *param_1) { ulong uVar1; undefined4 *puVar2; uVar1 = *param_1; if ((uVar1 < 6) || (99 < uVar1)) { printLine(&UNK_004012e0); } else { puVar2 = (undefined4 *)func_0x00400ab0(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400a20(puVar2); } return; }
['gcc']
11,440
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65_bad() { size_t data; /* define a function pointer */ void (*funcPtr) (size_t) = CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_badSink; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* use the function pointer */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117212/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65_bad(void) { int iVar1; iVar1 = func_0x00400ae0(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_badSink((long)iVar1); return; }
['gcc']
11,441
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117212/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,442
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_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/117212/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_004011e8); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,443
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_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/117212/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401288); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,444
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_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/117212/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_65b_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_004012c0); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,445
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66_bad() { size_t data; size_t dataArray[5]; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); /* put data in array */ dataArray[2] = data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_badSink(dataArray); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* put data in array */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117213/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66_bad(void) { int iVar1; undefined auStack_38 [16]; long lStack_28; long lStack_10; lStack_10 = 0; iVar1 = func_0x00400ae0(); lStack_28 = (long)iVar1; lStack_10 = lStack_28; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_badSink(auStack_38); return; }
['gcc']
11,446
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117213/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,447
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_badSink(size_t dataArray[]) { /* copy data out of dataArray */ size_t data = dataArray[2]; { 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"); } } }
['/* copy data out of dataArray */', '/* 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/117213/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_badSink(long param_1) { undefined4 *puVar1; if (*(ulong *)(param_1 + 0x10) < 6) { printLine(&UNK_004011e8); } else { puVar1 = (undefined4 *)func_0x00400ab0(*(ulong *)(param_1 + 0x10)); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,448
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_goodG2BSink(size_t dataArray[]) { size_t data = dataArray[2]; { 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/117213/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_goodG2BSink(long param_1) { undefined4 *puVar1; if (*(ulong *)(param_1 + 0x10) < 6) { printLine(&UNK_004012a8); } else { puVar1 = (undefined4 *)func_0x00400ab0(*(ulong *)(param_1 + 0x10)); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,449
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_goodB2GSink(size_t dataArray[]) { size_t data = dataArray[2]; { 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/117213/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_66b_goodB2GSink(long param_1) { ulong uVar1; undefined4 *puVar2; uVar1 = *(ulong *)(param_1 + 0x10); if ((uVar1 < 6) || (99 < uVar1)) { printLine(&UNK_004012e0); } else { puVar2 = (undefined4 *)func_0x00400ab0(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400a20(puVar2); } return; }
['gcc']
11,450
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_bad() { size_t data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_structType myStruct; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); myStruct.structFirst = data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_badSink(myStruct); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117214/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_bad(void) { int iVar1; iVar1 = func_0x00400ae0(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_badSink((long)iVar1); return; }
['gcc']
11,451
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117214/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,452
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_badSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_structType myStruct) { size_t data = myStruct.structFirst; { 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/117214/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_004011e8); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,453
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_goodG2BSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_structType myStruct) { size_t data = myStruct.structFirst; { 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/117214/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401298); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,454
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_goodB2GSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67_structType myStruct) { size_t data = myStruct.structFirst; { 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/117214/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_67b_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_004012d0); } else { puVar1 = (undefined4 *)func_0x00400ab0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,455
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_bad() { size_t data; /* Initialize data */ data = 0; /* POTENTIAL FLAW: Set data to a random value */ data = rand(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_badData = data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117215/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_bad(void) { int iVar1; iVar1 = func_0x00400ae0(); CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_badData = (long)iVar1; CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_badSink(); return; }
['gcc']
11,456
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117215/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,457
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_badSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_badData; { 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/117215/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_badSink(void) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_badData < 6) { printLine(&UNK_004011e8); } else { puVar1 = (undefined4 *) func_0x00400ab0(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_badData); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,458
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_goodG2BSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodG2BData; { 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/117215/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_goodG2BSink(void) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodG2BData < 6) { printLine(&UNK_00401298); } else { puVar1 = (undefined4 *) func_0x00400ab0(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodG2BData); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,459
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_goodB2GSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodB2GData; { 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/117215/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68b_goodB2GSink(void) { undefined4 *puVar1; if ((CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodB2GData < 6) || (99 < CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodB2GData)) { printLine(&UNK_004012d0); } else { puVar1 = (undefined4 *) func_0x00400ab0(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_68_goodB2GData); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400a20(puVar1); } return; }
['gcc']
11,460
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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 } { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117223/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015c8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015d4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015d4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004015f0); } return; }
['gcc']
11,461
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117223/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_01_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,462
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117224/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_02.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_02_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_02_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015c8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015d4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015d4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004015f0); } return; }
['gcc']
11,463
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117224/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_02.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_02_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_02_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,464
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117225/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_03.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_03_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_03_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015c8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015d4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015d4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004015f0); } return; }
['gcc']
11,465
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117225/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_03.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_03_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_03_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,466
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117226/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_04.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_04_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_04_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015f0); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015fc); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015fc); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401618); } return; }
['gcc']
11,467
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117226/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_04.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_04_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_04_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,468
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117227/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_05.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_05_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_05_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; if (staticTrue != 0) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } if (staticTrue != 0) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,469
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117227/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_05.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_05_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_05_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,470
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117228/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_06.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_06_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_06_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015ec); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015f8); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f8); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,471
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117228/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_06.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_06_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_06_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,472
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117229/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_07.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_07_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_07_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; if (staticFive == 5) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } if (staticFive == 5) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,473
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117229/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_07.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_07_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_07_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,474
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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()) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117230/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_08.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_08_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_08_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_00401608); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } iVar1 = staticReturnsTrue(); if (iVar1 != 0) { uVar2 = func_0x00400d10(&UNK_00401614); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_00401614); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401630); } } return; }
['gcc']
11,475
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117230/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_08.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_08_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_08_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,476
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117231/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_09.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_09_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_09_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; if (GLOBAL_CONST_TRUE != 0) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } if (GLOBAL_CONST_TRUE != 0) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,477
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117231/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_09.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_09_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_09_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,478
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117232/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_10.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_10_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_10_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; if (globalTrue != 0) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } if (globalTrue != 0) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,479
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117232/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_10.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_10_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_10_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,480
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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()) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117233/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_11.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_11_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_11_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,481
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117233/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_11.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_11_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_11_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,482
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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()) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } else { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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 wcscpy() 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/117234/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_28; undefined8 uStack_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_00401658); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uVar2 = func_0x00400d10(&UNK_00401664); if ((uVar2 < uStack_10) && (uStack_10 < 100)) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_00401664); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004016b8); } } else { uVar2 = func_0x00400d10(&UNK_00401664); if (uVar2 < uStack_10) { uStack_28 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_28,&UNK_00401664); printWLine(uStack_28); func_0x00400cb0(uStack_28); } else { printLine(&UNK_00401680); } } return; }
['gcc']
11,483
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117234/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_12_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,484
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117235/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_13.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_13_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_13_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; if (GLOBAL_CONST_FIVE == 5) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } if (GLOBAL_CONST_FIVE == 5) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,485
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117235/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_13.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_13_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_13_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,486
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117236/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_14.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_14_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_14_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; if (globalFive == 5) { iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } } if (globalFive == 5) { uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015f4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,487
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117236/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_14.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_14_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_14_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,488
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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: { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117237/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_15.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_15_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_15_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015c8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015d4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015d4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004015f0); } return; }
['gcc']
11,489
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117237/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_15.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_15_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_15_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,490
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117238/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015c8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015d4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015d4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004015f0); } return; }
['gcc']
11,491
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117238/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_16_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,492
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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++) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117239/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_28; int iStack_24; undefined8 uStack_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_0x00400e20(2,1,6); if (iStack_24 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015f8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_24,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_28 = func_0x00400cc0(iStack_24,auStack_58,0x19,0), iStack_28 != -1)) && (iStack_28 != 0)) { auStack_58[iStack_28] = 0; uStack_18 = func_0x00400de0(auStack_58,0,0); } } if (iStack_24 != -1) { func_0x00400d30(iStack_24); } } for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) { uVar2 = func_0x00400d10(&UNK_00401604); if (uVar2 < uStack_18) { uStack_20 = func_0x00400db0(uStack_18 << 2); func_0x00400d80(uStack_20,&UNK_00401604); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_00401620); } } return; }
['gcc']
11,493
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117239/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_17_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,494
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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: { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() 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 > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(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 wcscpy() 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/117240/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18_bad(void) { int iVar1; ulong uVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015c8); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uVar2 = func_0x00400d10(&UNK_004015d4); if (uVar2 < uStack_10) { uStack_20 = func_0x00400db0(uStack_10 << 2); func_0x00400d80(uStack_20,&UNK_004015d4); printWLine(uStack_20); func_0x00400cb0(uStack_20); } else { printLine(&UNK_004015f0); } return; }
['gcc']
11,495
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117240/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_18_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,496
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117241/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_21.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_21_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_00401643); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } badStatic = 1; badSink(uStack_10); return; }
['gcc']
11,497
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_21_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117241/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_21.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_21_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_21_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']
11,498
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_connect_socket_22_badGlobal = 1; /* true */ CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117242/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004015f4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badGlobal = 1; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badSink(uStack_10); return; }
['gcc']
11,499
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117242/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']