Unnamed: 0
int64
0
56k
source_code
stringlengths
55
5.98k
comments
stringlengths
2
1.76k
label
stringclasses
68 values
dataset_name
stringclasses
1 value
file_name
stringlengths
208
265
function
stringlengths
27
87
decompiled_code
stringlengths
68
3.97k
compiler_options
stringclasses
1 value
10,900
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_badSink(param_1); return; }
['gcc']
10,901
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodG2BSink(param_1); return; }
['gcc']
10,902
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53b_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodB2GSink(param_1); return; }
['gcc']
10,903
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_badSink(param_1); return; }
['gcc']
10,904
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodG2BSink(param_1); return; }
['gcc']
10,905
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53c_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodB2GSink(param_1); return; }
['gcc']
10,906
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401578); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,907
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401658); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,908
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117014/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_53d_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401690); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,909
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400d90(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401594); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400d50(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_badSink(uStack_10); return; }
['gcc']
10,910
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,911
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_badSink(param_1); return; }
['gcc']
10,912
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodG2BSink(param_1); return; }
['gcc']
10,913
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54b_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodB2GSink(param_1); return; }
['gcc']
10,914
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_badSink(param_1); return; }
['gcc']
10,915
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodG2BSink(param_1); return; }
['gcc']
10,916
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54c_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodB2GSink(param_1); return; }
['gcc']
10,917
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_badSink(param_1); return; }
['gcc']
10,918
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodG2BSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodG2BSink(param_1); return; }
['gcc']
10,919
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54d_goodB2GSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodB2GSink(param_1); return; }
['gcc']
10,920
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401598); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,921
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401688); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,922
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117015/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_54e_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_004016c0); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,923
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61_bad() { size_t data; /* Initialize data */ data = 0; data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117016/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61_bad(void) { ulong uVar1; undefined4 *puVar2; uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_badSource(0); if (uVar1 < 6) { printLine(&UNK_00401548); } else { puVar2 = (undefined4 *)func_0x00400d20(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400c40(puVar2); } return; }
['gcc']
10,924
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117016/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,925
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_badSource(size_t data) { { #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 } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117016/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_badSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_badSource(undefined8 param_1) { int iVar1; undefined8 uStack_50; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_10; int iStack_c; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); uStack_50 = param_1; if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401544); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_50 = func_0x00400d50(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } return uStack_50; }
['gcc']
10,926
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117016/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_goodG2BSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_goodG2BSource(void) { return 0x14; }
['gcc']
10,927
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_goodB2GSource(size_t data) { { #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 } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117016/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_goodB2GSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_61b_goodB2GSource(undefined8 param_1) { int iVar1; undefined8 uStack_50; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_10; int iStack_c; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); uStack_50 = param_1; if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_004015f4); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_50 = func_0x00400d50(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } return uStack_50; }
['gcc']
10,928
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117018/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = 0; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_18 = func_0x00400d50(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_badSink(&uStack_18); return; }
['gcc']
10,929
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117018/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,930
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117018/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_badSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_00401558); } else { puVar1 = (undefined4 *)func_0x00400d20(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,931
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117018/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_goodG2BSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_00401608); } else { puVar1 = (undefined4 *)func_0x00400d20(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,932
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117018/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_63b_goodB2GSink(ulong *param_1) { ulong uVar1; undefined4 *puVar2; uVar1 = *param_1; if ((uVar1 < 6) || (99 < uVar1)) { printLine(&UNK_00401640); } else { puVar2 = (undefined4 *)func_0x00400d20(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400c40(puVar2); } return; }
['gcc']
10,933
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117019/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = 0; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_18 = func_0x00400d50(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_badSink(&uStack_18); return; }
['gcc']
10,934
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117019/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,935
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117019/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_badSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_00401558); } else { puVar1 = (undefined4 *)func_0x00400d20(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,936
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117019/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_goodG2BSink(ulong *param_1) { undefined4 *puVar1; if (*param_1 < 6) { printLine(&UNK_00401618); } else { puVar1 = (undefined4 *)func_0x00400d20(*param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,937
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117019/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_64b_goodB2GSink(ulong *param_1) { ulong uVar1; undefined4 *puVar2; uVar1 = *param_1; if ((uVar1 < 6) || (99 < uVar1)) { printLine(&UNK_00401650); } else { puVar2 = (undefined4 *)func_0x00400d20(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400c40(puVar2); } return; }
['gcc']
10,938
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65_bad() { size_t data; /* define a function pointer */ void (*funcPtr) (size_t) = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_badSink; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* use the function pointer */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117020/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65_bad(void) { int iVar1; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; undefined8 uStack_10; pcStack_18 = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_badSink; uStack_10 = 0; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401554); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_58,0x19,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_58[iStack_20] = 0; uStack_10 = func_0x00400d50(auStack_58,0,0); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } (*pcStack_18)(uStack_10); return; }
['gcc']
10,939
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117020/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,940
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117020/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401558); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,941
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117020/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_004015f8); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,942
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117020/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_65b_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401630); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,943
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66_bad() { size_t data; size_t dataArray[5]; /* 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 } /* put data in array */ dataArray[2] = data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_badSink(dataArray); }
['/* 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 */', '/* put data in array */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117021/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66_bad(void) { int iVar1; undefined auStack_78 [32]; undefined2 uStack_58; undefined2 uStack_56; undefined4 uStack_54; undefined auStack_48 [16]; undefined8 uStack_38; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400d90(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = func_0x00400cf0(&UNK_00401554); uStack_56 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_14,&uStack_58,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400c50(iStack_14,auStack_78,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_78[iStack_18] = 0; uStack_10 = func_0x00400d50(auStack_78,0,0); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } uStack_38 = uStack_10; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_badSink(auStack_48); return; }
['gcc']
10,944
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117021/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,945
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117021/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_badSink(long param_1) { undefined4 *puVar1; if (*(ulong *)(param_1 + 0x10) < 6) { printLine(&UNK_00401558); } else { puVar1 = (undefined4 *)func_0x00400d20(*(ulong *)(param_1 + 0x10)); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,946
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117021/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_goodG2BSink(long param_1) { undefined4 *puVar1; if (*(ulong *)(param_1 + 0x10) < 6) { printLine(&UNK_00401618); } else { puVar1 = (undefined4 *)func_0x00400d20(*(ulong *)(param_1 + 0x10)); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,947
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117021/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_66b_goodB2GSink(long param_1) { ulong uVar1; undefined4 *puVar2; uVar1 = *(ulong *)(param_1 + 0x10); if ((uVar1 < 6) || (99 < uVar1)) { printLine(&UNK_00401650); } else { puVar2 = (undefined4 *)func_0x00400d20(uVar1); *puVar2 = 0x6c6c6568; *(undefined2 *)(puVar2 + 1) = 0x6f; printLine(puVar2); func_0x00400c40(puVar2); } return; }
['gcc']
10,948
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_bad() { size_t data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_structType myStruct; /* 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 } myStruct.structFirst = data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_badSink(myStruct); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117022/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_bad(void) { int iVar1; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined8 uStack_20; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400d90(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401554); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400c50(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400d50(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } uStack_20 = uStack_10; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_badSink(uStack_10); return; }
['gcc']
10,949
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117022/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,950
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_badSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117022/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_badSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401558); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,951
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_goodG2BSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117022/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (param_1 < 6) { printLine(&UNK_00401608); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,952
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_goodB2GSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117022/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_67b_goodB2GSink(ulong param_1) { undefined4 *puVar1; if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401640); } else { puVar1 = (undefined4 *)func_0x00400d20(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,953
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_badData = data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117023/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400d90(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400c50(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400d50(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_badData = uStack_10; CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_badSink(); return; }
['gcc']
10,954
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117023/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,955
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_badSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117023/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_badSink(void) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_badData < 6) { printLine(&UNK_00401558); } else { puVar1 = (undefined4 *) func_0x00400d20(CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_badData); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,956
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_goodG2BSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117023/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_goodG2BSink(void) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_goodG2BData < 6) { printLine(&UNK_00401608); } else { puVar1 = (undefined4 *) func_0x00400d20( CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_goodG2BData ); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,957
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_goodB2GSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_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/117023/CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68b_goodB2GSink(void) { undefined4 *puVar1; if ((CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_goodB2GData < 6) || (99 < CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_goodB2GData)) { printLine(&UNK_00401640); } else { puVar1 = (undefined4 *) func_0x00400d20( CWE789_Uncontrolled_Mem_Alloc__malloc_char_connect_socket_68_goodB2GData ); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400c40(puVar1); } return; }
['gcc']
10,958
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01_bad() { size_t data; /* Initialize data */ data = 0; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117031/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401328); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } if (uStack_10 < 6) { printLine(&UNK_00401338); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } return; }
['gcc']
10,959
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117031/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_01_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,960
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02_bad() { size_t data; /* Initialize data */ data = 0; if(1) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(1) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117032/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401328); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } if (uStack_10 < 6) { printLine(&UNK_00401338); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } return; }
['gcc']
10,961
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117032/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_02_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,962
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03_bad() { size_t data; /* Initialize data */ data = 0; if(5==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(5==5) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117033/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401328); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } if (uStack_10 < 6) { printLine(&UNK_00401338); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } return; }
['gcc']
10,963
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117033/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_03_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,964
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04_bad() { size_t data; /* Initialize data */ data = 0; if(STATIC_CONST_TRUE) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(STATIC_CONST_TRUE) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117034/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401340); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } if (uStack_10 < 6) { printLine(&UNK_00401350); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } return; }
['gcc']
10,965
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117034/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_04_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,966
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05_bad() { size_t data; /* Initialize data */ data = 0; if(staticTrue) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(staticTrue) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117035/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; if (staticTrue != 0) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } if (staticTrue != 0) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,967
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117035/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_05_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,968
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06_bad() { size_t data; /* Initialize data */ data = 0; if(STATIC_CONST_FIVE==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(STATIC_CONST_FIVE==5) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117036/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_0040133c); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } if (uStack_10 < 6) { printLine(&UNK_00401350); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } return; }
['gcc']
10,969
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117036/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_06_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,970
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07_bad() { size_t data; /* Initialize data */ data = 0; if(staticFive==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(staticFive==5) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117037/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; if (staticFive == 5) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } if (staticFive == 5) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,971
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117037/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_07_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,972
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08_bad() { size_t data; /* Initialize data */ data = 0; if(staticReturnsTrue()) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(staticReturnsTrue()) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117038/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08_bad(void) { int iVar1; long lVar2; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar2 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar2 == 0) { printLine(&UNK_00401358); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } iVar1 = staticReturnsTrue(); if (iVar1 != 0) { if (uStack_10 < 6) { printLine(&UNK_00401368); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,973
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117038/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_08_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,974
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09_bad() { size_t data; /* Initialize data */ data = 0; if(GLOBAL_CONST_TRUE) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(GLOBAL_CONST_TRUE) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117039/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; if (GLOBAL_CONST_TRUE != 0) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } if (GLOBAL_CONST_TRUE != 0) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,975
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117039/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_09_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,976
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10_bad() { size_t data; /* Initialize data */ data = 0; if(globalTrue) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(globalTrue) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117040/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; if (globalTrue != 0) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } if (globalTrue != 0) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,977
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117040/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_10_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,978
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11_bad() { size_t data; /* Initialize data */ data = 0; if(globalReturnsTrue()) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(globalReturnsTrue()) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117041/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11_bad(void) { int iVar1; long lVar2; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar2 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar2 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } iVar1 = globalReturnsTrue(); if (iVar1 != 0) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,979
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117041/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_11_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,980
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_bad() { size_t data; /* Initialize data */ data = 0; if(globalReturnsTrueOrFalse()) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } else { /* FIX: Use a relatively small number for memory allocation */ data = 20; } if(globalReturnsTrueOrFalse()) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } else { { char * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING) && data < 100) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* FIX: Use a relatively small number for memory allocation */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117042/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_bad(void) { int iVar1; long lVar2; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined2 uStack_30; undefined4 *puStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uStack_10 = 0x14; } else { uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; lVar2 = func_0x00400b70(&uStack_48,0x1a,stdin); if (lVar2 == 0) { printLine(&UNK_00401398); } else { uStack_10 = func_0x00400be0(&uStack_48,0,0); } } iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { if ((uStack_10 < 6) || (99 < uStack_10)) { printLine(&UNK_004013e0); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } else if (uStack_10 < 6) { printLine(&UNK_004013a8); } else { puStack_20 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_20 = 0x6c6c6568; *(undefined2 *)(puStack_20 + 1) = 0x6f; printLine(puStack_20); func_0x00400b10(puStack_20); } return; }
['gcc']
10,981
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117042/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_12_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
10,982
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13_bad() { size_t data; /* Initialize data */ data = 0; if(GLOBAL_CONST_FIVE==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(GLOBAL_CONST_FIVE==5) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117043/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; if (GLOBAL_CONST_FIVE == 5) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } if (GLOBAL_CONST_FIVE == 5) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,983
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117043/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_13_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,984
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_bad() { size_t data; /* Initialize data */ data = 0; if(globalFive==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } if(globalFive==5) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117044/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined4 *puStack_18; ulong uStack_10; uStack_10 = 0; if (globalFive == 5) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } } if (globalFive == 5) { if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_18 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_18 = 0x6c6c6568; *(undefined2 *)(puStack_18 + 1) = 0x6f; printLine(puStack_18); func_0x00400b10(puStack_18); } } return; }
['gcc']
10,985
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117044/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_14_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
10,986
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_bad() { int i,j; size_t data; /* Initialize data */ data = 0; for(i = 0; i < 1; i++) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } } for(j = 0; j < 1; j++) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117047/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_bad(void) { long lVar1; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined2 uStack_30; undefined4 *puStack_20; ulong uStack_18; int iStack_10; int iStack_c; uStack_18 = 0; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; lVar1 = func_0x00400b70(&uStack_48,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401348); } else { uStack_18 = func_0x00400be0(&uStack_48,0,0); } } for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) { if (uStack_18 < 6) { printLine(&UNK_00401358); } else { puStack_20 = (undefined4 *)func_0x00400bb0(uStack_18); *puStack_20 = 0x6c6c6568; *(undefined2 *)(puStack_20 + 1) = 0x6f; printLine(puStack_20); func_0x00400b10(puStack_20); } } return; }
['gcc']
10,987
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117047/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_17_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
10,988
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_bad() { size_t data; /* Initialize data */ data = 0; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badGlobal = 1; /* true */ CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* true */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117050/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_bad(void) { long lVar1; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined8 uStack_10; uStack_10 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400b70(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401354); } else { uStack_10 = func_0x00400be0(&uStack_38,0,0); } CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badGlobal = 1; CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badSink(uStack_10); return; }
['gcc']
10,989
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117050/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']
10,990
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badSink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badGlobal) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117050/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badSink(ulong param_1) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_badGlobal != 0) { if (param_1 < 6) { printLine(&UNK_00401358); } else { puVar1 = (undefined4 *)func_0x00400bb0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400b10(puVar1); } } return; }
['gcc']
10,991
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G1Sink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { { char * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING) && data < 100) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117050/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G1Sink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G1Sink(ulong param_1) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G1Global == 0) { if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401530); } else { puVar1 = (undefined4 *)func_0x00400bb0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400b10(puVar1); } } else { printLine(&UNK_00401518); } return; }
['gcc']
10,992
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G2Sink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G2Global) { { char * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING) && data < 100) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117050/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G2Sink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G2Sink(ulong param_1) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodB2G2Global != 0) { if ((param_1 < 6) || (99 < param_1)) { printLine(&UNK_00401530); } else { puVar1 = (undefined4 *)func_0x00400bb0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400b10(puVar1); } } return; }
['gcc']
10,993
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodG2BSink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodG2BGlobal) { { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117050/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodG2BSink(ulong param_1) { undefined4 *puVar1; if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_22_goodG2BGlobal != 0) { if (param_1 < 6) { printLine(&UNK_00401570); } else { puVar1 = (undefined4 *)func_0x00400bb0(param_1); *puVar1 = 0x6c6c6568; *(undefined2 *)(puVar1 + 1) = 0x6f; printLine(puVar1); func_0x00400b10(puVar1); } } return; }
['gcc']
10,994
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31_bad() { size_t data; /* Initialize data */ data = 0; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } { size_t dataCopy = data; size_t data = dataCopy; { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117051/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31_bad(void) { long lVar1; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined2 uStack_30; undefined4 *puStack_28; ulong uStack_20; ulong uStack_18; ulong uStack_10; uStack_10 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; lVar1 = func_0x00400b70(&uStack_48,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_48,0,0); } uStack_18 = uStack_10; uStack_20 = uStack_10; if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_28 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_28 = 0x6c6c6568; *(undefined2 *)(puStack_28 + 1) = 0x6f; printLine(puStack_28); func_0x00400b10(puStack_28); } return; }
['gcc']
10,995
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117051/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_31_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,996
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32_bad() { size_t data; size_t *dataPtr1 = &data; size_t *dataPtr2 = &data; /* Initialize data */ data = 0; { size_t data = *dataPtr1; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } *dataPtr1 = data; } { size_t data = *dataPtr2; { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117052/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32_bad(void) { long lVar1; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined2 uStack_40; ulong uStack_38; undefined4 *puStack_30; ulong uStack_28; ulong *puStack_20; ulong *puStack_18; ulong uStack_10; puStack_18 = &uStack_38; puStack_20 = &uStack_38; uStack_38 = 0; uStack_10 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; lVar1 = func_0x00400b70(&uStack_58,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401358); } else { uStack_10 = func_0x00400be0(&uStack_58,0,0); } *puStack_18 = uStack_10; uStack_28 = *puStack_20; if (uStack_28 < 6) { printLine(&UNK_00401368); } else { puStack_30 = (undefined4 *)func_0x00400bb0(uStack_28); *puStack_30 = 0x6c6c6568; *(undefined2 *)(puStack_30 + 1) = 0x6f; printLine(puStack_30); func_0x00400b10(puStack_30); } return; }
['gcc']
10,997
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117052/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_32_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
10,998
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_bad() { size_t data; CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_unionType myUnion; /* Initialize data */ data = 0; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } else { printLine("fgets() failed."); } } myUnion.unionFirst = data; { size_t data = myUnion.unionSecond; { char * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the strcpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > strlen(HELLO_STRING)) { myString = (char *)malloc(data*sizeof(char)); /* Copy a small string into myString */ strcpy(myString, HELLO_STRING); printLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117054/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_bad(void) { long lVar1; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined2 uStack_30; ulong uStack_28; undefined4 *puStack_20; ulong uStack_18; ulong uStack_10; uStack_10 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; lVar1 = func_0x00400b70(&uStack_48,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_00401338); } else { uStack_10 = func_0x00400be0(&uStack_48,0,0); } uStack_28 = uStack_10; uStack_18 = uStack_10; if (uStack_10 < 6) { printLine(&UNK_00401348); } else { puStack_20 = (undefined4 *)func_0x00400bb0(uStack_10); *puStack_20 = 0x6c6c6568; *(undefined2 *)(puStack_20 + 1) = 0x6f; printLine(puStack_20); func_0x00400b10(puStack_20); } return; }
['gcc']
10,999
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117054/CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34.c
CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_fgets_34_good(void) { goodG2B(); goodB2G(); return; }
['gcc']