Unnamed: 0
int64
0
56k
source_code
stringlengths
55
5.98k
comments
stringlengths
2
1.76k
label
stringclasses
68 values
dataset_name
stringclasses
1 value
file_name
stringlengths
208
265
function
stringlengths
27
87
decompiled_code
stringlengths
68
3.97k
compiler_options
stringclasses
1 value
11,500
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badSink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badGlobal) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117242/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; if (CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_badGlobal != 0) { uVar1 = func_0x00400d10(&UNK_004015f8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004015f8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401610); } } return; }
['gcc']
11,501
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G1Sink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } }
['/* 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117242/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G1Sink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G1Sink(ulong param_1) { ulong uVar1; undefined8 uVar2; if (CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G1Global == 0) { uVar1 = func_0x00400d10(&UNK_00401870); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401870); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401888); } } else { printLine(&UNK_00401858); } return; }
['gcc']
11,502
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G2Sink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G2Global) { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117242/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G2Sink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G2Sink(ulong param_1) { ulong uVar1; undefined8 uVar2; if (CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodB2G2Global != 0) { uVar1 = func_0x00400d10(&UNK_00401870); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401870); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401888); } } return; }
['gcc']
11,503
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodG2BSink(size_t data) { if(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodG2BGlobal) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117242/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; if (CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_22_goodG2BGlobal != 0) { uVar1 = func_0x00400d10(&UNK_00401870); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401870); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004018c8); } } return; }
['gcc']
11,504
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { size_t dataCopy = data; size_t data = dataCopy; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117243/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31_bad(void) { int iVar1; ulong uVar2; undefined auStack_68 [32]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined8 uStack_30; ulong uStack_28; ulong uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = func_0x00400d70(&UNK_004015d8); uStack_46 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_48,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_68,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_68[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_68,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uStack_20 = uStack_10; uStack_28 = uStack_10; uVar2 = func_0x00400d10(&UNK_004015e4); if (uVar2 < uStack_28) { uStack_30 = func_0x00400db0(uStack_28 << 2); func_0x00400d80(uStack_30,&UNK_004015e4); printWLine(uStack_30); func_0x00400cb0(uStack_30); } else { printLine(&UNK_00401600); } return; }
['gcc']
11,505
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117243/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_31_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,506
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32_bad() { size_t data; size_t *dataPtr1 = &data; size_t *dataPtr2 = &data; /* Initialize data */ data = 0; { size_t data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { size_t data = *dataPtr2; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117244/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32_bad(void) { int iVar1; ulong uVar2; undefined auStack_78 [32]; undefined2 uStack_58; undefined2 uStack_56; undefined4 uStack_54; ulong uStack_40; undefined8 uStack_38; ulong uStack_30; int iStack_28; int iStack_24; ulong *puStack_20; ulong *puStack_18; ulong uStack_10; puStack_18 = &uStack_40; puStack_20 = &uStack_40; uStack_40 = 0; uStack_10 = 0; iStack_24 = 0xffffffff; iStack_24 = func_0x00400e20(2,1,6); if (iStack_24 != -1) { func_0x00400d20(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = func_0x00400d70(&UNK_004015f8); uStack_56 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_24,&uStack_58,0x10); if (((iVar1 != -1) && (iStack_28 = func_0x00400cc0(iStack_24,auStack_78,0x19,0), iStack_28 != -1)) && (iStack_28 != 0)) { auStack_78[iStack_28] = 0; uStack_10 = func_0x00400de0(auStack_78,0,0); } } if (iStack_24 != -1) { func_0x00400d30(iStack_24); } *puStack_18 = uStack_10; uStack_30 = *puStack_20; uVar2 = func_0x00400d10(&UNK_00401604); if (uVar2 < uStack_30) { uStack_38 = func_0x00400db0(uStack_30 << 2); func_0x00400d80(uStack_38,&UNK_00401604); printWLine(uStack_38); func_0x00400cb0(uStack_38); } else { printLine(&UNK_00401620); } return; }
['gcc']
11,507
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117244/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_32_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,508
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_bad() { size_t data; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_unionType myUnion; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { size_t data = myUnion.unionSecond; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117246/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_bad(void) { int iVar1; ulong uVar2; undefined auStack_68 [32]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; ulong uStack_30; undefined8 uStack_28; ulong uStack_20; int iStack_18; int iStack_14; ulong uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = func_0x00400d70(&UNK_004015d8); uStack_46 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_48,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_68,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_68[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_68,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uStack_30 = uStack_10; uStack_20 = uStack_10; uVar2 = func_0x00400d10(&UNK_004015e4); if (uVar2 < uStack_20) { uStack_28 = func_0x00400db0(uStack_20 << 2); func_0x00400d80(uStack_28,&UNK_004015e4); printWLine(uStack_28); func_0x00400cb0(uStack_28); } else { printLine(&UNK_00401600); } return; }
['gcc']
11,509
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117246/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_34_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,510
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117247/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_00401633); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } badSink(uStack_10); return; }
['gcc']
11,511
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117247/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_41_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,512
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42_bad() { size_t data; /* Initialize data */ data = 0; data = badSource(data); { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117248/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42_bad(void) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = badSource(0); uVar2 = func_0x00400d10(&UNK_004015f4); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004015f4); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,513
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117248/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_42_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,514
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44_bad() { size_t data; /* define a function pointer */ void (*funcPtr) (size_t) = badSink; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */', '/* use the function pointer */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117250/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44_bad(void) { int iVar1; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; undefined8 uStack_10; pcStack_18 = badSink; uStack_10 = 0; iStack_1c = 0xffffffff; iStack_1c = func_0x00400e20(2,1,6); if (iStack_1c != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_00401633); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400cc0(iStack_1c,auStack_58,0x19,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_58[iStack_20] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_1c != -1) { func_0x00400d30(iStack_1c); } (*pcStack_18)(uStack_10); return; }
['gcc']
11,515
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117250/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_44_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,516
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_badData = data; badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117251/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_00401643); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_badData = uStack_10; badSink(); return; }
['gcc']
11,517
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117251/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_45_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,518
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117252/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004015e4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_badSink(uStack_10); return; }
['gcc']
11,519
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117252/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,520
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_badSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117252/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004015e8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004015e8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401600); } return; }
['gcc']
11,521
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_goodG2BSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117252/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401698); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401698); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004016b0); } return; }
['gcc']
11,522
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_goodB2GSink(size_t data) { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117252/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_51b_goodB2GSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401698); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401698); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004016e8); } return; }
['gcc']
11,523
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_00401604); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_badSink(uStack_10); return; }
['gcc']
11,524
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,525
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_badSink(param_1); return; }
['gcc']
11,526
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_goodG2BSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodG2BSink(param_1); return; }
['gcc']
11,527
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52b_goodB2GSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodB2GSink(param_1); return; }
['gcc']
11,528
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_badSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401608); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401608); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401620); } return; }
['gcc']
11,529
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodG2BSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004016c8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004016c8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004016e0); } return; }
['gcc']
11,530
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodB2GSink(size_t data) { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117253/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_52c_goodB2GSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004016c8); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004016c8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401718); } return; }
['gcc']
11,531
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53_bad() { size_t data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to unsigned int */ data = strtoul(inputBuffer, NULL, 0); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to unsigned int */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53_bad(void) { int iVar1; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; undefined8 uStack_10; uStack_10 = 0; iStack_14 = 0xffffffff; iStack_14 = func_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_00401614); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_badSink(uStack_10); return; }
['gcc']
11,532
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,533
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_badSink(param_1); return; }
['gcc']
11,534
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_goodG2BSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodG2BSink(param_1); return; }
['gcc']
11,535
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53b_goodB2GSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodB2GSink(param_1); return; }
['gcc']
11,536
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_badSink(param_1); return; }
['gcc']
11,537
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodG2BSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodG2BSink(param_1); return; }
['gcc']
11,538
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53c_goodB2GSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodB2GSink(param_1); return; }
['gcc']
11,539
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_badSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401618); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401618); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401630); } return; }
['gcc']
11,540
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodG2BSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401708); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401708); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401720); } return; }
['gcc']
11,541
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodB2GSink(size_t data) { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117254/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_53d_goodB2GSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401708); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401708); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401758); } return; }
['gcc']
11,542
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_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/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_00401634); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_badSink(uStack_10); return; }
['gcc']
11,543
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,544
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_badSink(param_1); return; }
['gcc']
11,545
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_goodG2BSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodG2BSink(param_1); return; }
['gcc']
11,546
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54b_goodB2GSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodB2GSink(param_1); return; }
['gcc']
11,547
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_badSink(param_1); return; }
['gcc']
11,548
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodG2BSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodG2BSink(param_1); return; }
['gcc']
11,549
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54c_goodB2GSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodB2GSink(param_1); return; }
['gcc']
11,550
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_badSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_badSink(data); }
[]
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_badSink(undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_badSink(param_1); return; }
['gcc']
11,551
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodG2BSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodG2BSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodG2BSink(param_1); return; }
['gcc']
11,552
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodB2GSink(size_t data) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54d_goodB2GSink (undefined8 param_1) { CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodB2GSink(param_1); return; }
['gcc']
11,553
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_badSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401638); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401638); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401650); } return; }
['gcc']
11,554
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodG2BSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401738); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401738); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401750); } return; }
['gcc']
11,555
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodB2GSink(size_t data) { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117255/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_54e_goodB2GSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_00401738); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_00401738); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401788); } return; }
['gcc']
11,556
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61_bad() { size_t data; /* Initialize data */ data = 0; data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b_badSource(data); { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117256/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61_bad(void) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b_badSource(0); uVar2 = func_0x00400d10(&UNK_004015e8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004015e8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401600); } return; }
['gcc']
11,557
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117256/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,558
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117256/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b_badSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); uStack_50 = param_1; if (iStack_c != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004015e4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400cc0(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_50 = func_0x00400de0(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400d30(iStack_c); } return uStack_50; }
['gcc']
11,559
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117256/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b_goodG2BSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b_goodG2BSource(void) { return 0x14; }
['gcc']
11,560
size_t CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117256/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_61b_goodB2GSource
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); uStack_50 = param_1; if (iStack_c != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004016a4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400cc0(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_50 = func_0x00400de0(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400d30(iStack_c); } return uStack_50; }
['gcc']
11,561
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_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/117258/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_c != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004015f4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400cc0(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_18 = func_0x00400de0(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400d30(iStack_c); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_badSink(&uStack_18); return; }
['gcc']
11,562
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117258/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,563
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_badSink(size_t * dataPtr) { size_t data = *dataPtr; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117258/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_badSink(ulong *param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *param_1; uVar2 = func_0x00400d10(&UNK_004015f8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004015f8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,564
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_goodG2BSink(size_t * dataPtr) { size_t data = *dataPtr; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117258/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_goodG2BSink(ulong *param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *param_1; uVar2 = func_0x00400d10(&UNK_004016a8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016a8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_004016c0); } return; }
['gcc']
11,565
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_goodB2GSink(size_t * dataPtr) { size_t data = *dataPtr; { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117258/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_63b_goodB2GSink(ulong *param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *param_1; uVar2 = func_0x00400d10(&UNK_004016a8); if ((uVar2 < uVar1) && (uVar1 < 100)) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016a8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_004016f8); } return; }
['gcc']
11,566
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_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/117259/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_c != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004015f4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400cc0(iStack_c,auStack_48,0x19,0), iStack_10 != -1) ) && (iStack_10 != 0)) { auStack_48[iStack_10] = 0; uStack_18 = func_0x00400de0(auStack_48,0,0); } } if (iStack_c != -1) { func_0x00400d30(iStack_c); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_badSink(&uStack_18); return; }
['gcc']
11,567
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117259/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,568
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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); { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117259/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_badSink(ulong *param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *param_1; uVar2 = func_0x00400d10(&UNK_004015f8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004015f8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,569
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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); { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117259/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_goodG2BSink(ulong *param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *param_1; uVar2 = func_0x00400d10(&UNK_004016b8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016b8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_004016d0); } return; }
['gcc']
11,570
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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); { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117259/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_64b_goodB2GSink(ulong *param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *param_1; uVar2 = func_0x00400d10(&UNK_004016b8); if ((uVar2 < uVar1) && (uVar1 < 100)) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016b8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401708); } return; }
['gcc']
11,571
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65_bad() { size_t data; /* define a function pointer */ void (*funcPtr) (size_t) = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117260/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_connect_socket_65b_badSink; uStack_10 = 0; iStack_1c = 0xffffffff; iStack_1c = func_0x00400e20(2,1,6); if (iStack_1c != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015e4); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400cc0(iStack_1c,auStack_58,0x19,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_58[iStack_20] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_1c != -1) { func_0x00400d30(iStack_1c); } (*pcStack_18)(uStack_10); return; }
['gcc']
11,572
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117260/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,573
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_badSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117260/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004015e8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004015e8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401600); } return; }
['gcc']
11,574
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_goodG2BSink(size_t data) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117260/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004016a8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004016a8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004016c0); } return; }
['gcc']
11,575
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_goodB2GSink(size_t data) { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117260/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_65b_goodB2GSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004016a8); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004016a8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004016f8); } return; }
['gcc']
11,576
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_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/117261/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = func_0x00400d70(&UNK_004015f4); uStack_56 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_58,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_78,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_78[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_78,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uStack_38 = uStack_10; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_badSink(auStack_48); return; }
['gcc']
11,577
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117261/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,578
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_badSink(size_t dataArray[]) { /* copy data out of dataArray */ size_t data = dataArray[2]; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* copy data out of dataArray */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117261/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_badSink(long param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *(ulong *)(param_1 + 0x10); uVar2 = func_0x00400d10(&UNK_004015f8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004015f8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,579
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_goodG2BSink(size_t dataArray[]) { size_t data = dataArray[2]; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117261/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_goodG2BSink(long param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *(ulong *)(param_1 + 0x10); uVar2 = func_0x00400d10(&UNK_004016c8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016c8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_004016e0); } return; }
['gcc']
11,580
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_goodB2GSink(size_t dataArray[]) { size_t data = dataArray[2]; { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117261/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_66b_goodB2GSink(long param_1) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = *(ulong *)(param_1 + 0x10); uVar2 = func_0x00400d10(&UNK_004016c8); if ((uVar2 < uVar1) && (uVar1 < 100)) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016c8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401718); } return; }
['gcc']
11,581
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_bad() { size_t data; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_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/117262/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400d70(&UNK_004015f4); uStack_36 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_58,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_58[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_58,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } uStack_20 = uStack_10; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_badSink(uStack_10); return; }
['gcc']
11,582
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117262/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,583
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_badSink(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_structType myStruct) { size_t data = myStruct.structFirst; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117262/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_badSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004015f8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004015f8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,584
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_goodG2BSink(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_structType myStruct) { size_t data = myStruct.structFirst; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117262/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_goodG2BSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004016b8); if (uVar1 < param_1) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004016b8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_004016d0); } return; }
['gcc']
11,585
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_goodB2GSink(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67_structType myStruct) { size_t data = myStruct.structFirst; { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117262/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_67b_goodB2GSink(ulong param_1) { ulong uVar1; undefined8 uVar2; uVar1 = func_0x00400d10(&UNK_004016b8); if ((uVar1 < param_1) && (param_1 < 100)) { uVar2 = func_0x00400db0(param_1 << 2); func_0x00400d80(uVar2,&UNK_004016b8); printWLine(uVar2); func_0x00400cb0(uVar2); } else { printLine(&UNK_00401708); } return; }
['gcc']
11,586
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_wchar_t_connect_socket_68_badData = data; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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/117263/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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_0x00400e20(2,1,6); if (iStack_14 != -1) { func_0x00400d20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400d70(&UNK_004015f4); uStack_26 = func_0x00400cf0(0x6987); iVar1 = func_0x00400df0(iStack_14,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_18 = func_0x00400cc0(iStack_14,auStack_48,0x19,0), iStack_18 != -1)) && (iStack_18 != 0)) { auStack_48[iStack_18] = 0; uStack_10 = func_0x00400de0(auStack_48,0,0); } } if (iStack_14 != -1) { func_0x00400d30(iStack_14); } CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_badData = uStack_10; CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_badSink(); return; }
['gcc']
11,587
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117263/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68a.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
11,588
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_badSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_badData; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117263/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_badSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_badSink(void) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_badData; uVar2 = func_0x00400d10(&UNK_004015f8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004015f8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401610); } return; }
['gcc']
11,589
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_goodG2BSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_goodG2BData; { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } }
['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117263/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_goodG2BSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_goodG2BSink(void) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_goodG2BData; uVar2 = func_0x00400d10(&UNK_004016b8); if (uVar2 < uVar1) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016b8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_004016d0); } return; }
['gcc']
11,590
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_goodB2GSink() { size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_goodB2GData; { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } }
['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117263/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_goodB2GSink
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68b_goodB2GSink(void) { ulong uVar1; ulong uVar2; undefined8 uVar3; uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_connect_socket_68_goodB2GData; uVar2 = func_0x00400d10(&UNK_004016b8); if ((uVar2 < uVar1) && (uVar1 < 100)) { uVar3 = func_0x00400db0(uVar1 << 2); func_0x00400d80(uVar3,&UNK_004016b8); printWLine(uVar3); func_0x00400cb0(uVar3); } else { printLine(&UNK_00401708); } return; }
['gcc']
11,591
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117280/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10_bad(void) { long lVar1; ulong uVar2; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined8 uStack_18; ulong uStack_10; uStack_10 = 0; if (globalTrue != 0) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400bf0(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_004013d8); } else { uStack_10 = func_0x00400c70(&uStack_38,0,0); } } if (globalTrue != 0) { uVar2 = func_0x00400bc0(&UNK_004013e8); if (uVar2 < uStack_10) { uStack_18 = func_0x00400c40(uStack_10 << 2); func_0x00400c10(uStack_18,&UNK_004013e8); printWLine(uStack_18); func_0x00400b80(uStack_18); } else { printLine(&UNK_00401400); } } return; }
['gcc']
11,592
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117280/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_10_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,593
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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()) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117281/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11_bad(void) { int iVar1; long lVar2; ulong uVar3; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined8 uStack_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_0x00400bf0(&uStack_38,0x1a,stdin); if (lVar2 == 0) { printLine(&UNK_004013d8); } else { uStack_10 = func_0x00400c70(&uStack_38,0,0); } } iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uVar3 = func_0x00400bc0(&UNK_004013e8); if (uVar3 < uStack_10) { uStack_18 = func_0x00400c40(uStack_10 << 2); func_0x00400c10(uStack_18,&UNK_004013e8); printWLine(uStack_18); func_0x00400b80(uStack_18); } else { printLine(&UNK_00401400); } } return; }
['gcc']
11,594
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117281/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_11_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,595
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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()) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } else { { wchar_t * myString; /* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING) && data < 100) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string or too large"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117282/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12_bad(void) { int iVar1; long lVar2; ulong uVar3; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined2 uStack_30; undefined8 uStack_20; undefined8 uStack_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_0x00400bf0(&uStack_48,0x1a,stdin); if (lVar2 == 0) { printLine(&UNK_00401448); } else { uStack_10 = func_0x00400c70(&uStack_48,0,0); } } iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uVar3 = func_0x00400bc0(&UNK_00401458); if ((uVar3 < uStack_10) && (uStack_10 < 100)) { uStack_18 = func_0x00400c40(uStack_10 << 2); func_0x00400c10(uStack_18,&UNK_00401458); printWLine(uStack_18); func_0x00400b80(uStack_18); } else { printLine(&UNK_004014a8); } } else { uVar3 = func_0x00400bc0(&UNK_00401458); if (uVar3 < uStack_10) { uStack_20 = func_0x00400c40(uStack_10 << 2); func_0x00400c10(uStack_20,&UNK_00401458); printWLine(uStack_20); func_0x00400b80(uStack_20); } else { printLine(&UNK_00401470); } } return; }
['gcc']
11,596
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117282/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_12_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
11,597
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117283/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13_bad(void) { long lVar1; ulong uVar2; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined8 uStack_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_0x00400bf0(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_004013d8); } else { uStack_10 = func_0x00400c70(&uStack_38,0,0); } } if (GLOBAL_CONST_FIVE == 5) { uVar2 = func_0x00400bc0(&UNK_004013e8); if (uVar2 < uStack_10) { uStack_18 = func_0x00400c40(uStack_10 << 2); func_0x00400c10(uStack_18,&UNK_004013e8); printWLine(uStack_18); func_0x00400b80(uStack_18); } else { printLine(&UNK_00401400); } } return; }
['gcc']
11,598
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117283/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13_good
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_13_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
11,599
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_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) { { wchar_t * myString; /* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough * for the wcscpy() function to not cause a buffer overflow */ /* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */ if (data > wcslen(HELLO_STRING)) { myString = (wchar_t *)malloc(data*sizeof(wchar_t)); /* Copy a small string into myString */ wcscpy(myString, HELLO_STRING); printWLine(myString); free(myString); } else { printLine("Input is less than the length of the source string"); } } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data 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 wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */']
['CWE789']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117284/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_14.c
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_14_bad
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_fgets_14_bad(void) { long lVar1; ulong uVar2; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined2 uStack_20; undefined8 uStack_18; ulong uStack_10; uStack_10 = 0; if (globalFive == 5) { uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; lVar1 = func_0x00400bf0(&uStack_38,0x1a,stdin); if (lVar1 == 0) { printLine(&UNK_004013d8); } else { uStack_10 = func_0x00400c70(&uStack_38,0,0); } } if (globalFive == 5) { uVar2 = func_0x00400bc0(&UNK_004013e8); if (uVar2 < uStack_10) { uStack_18 = func_0x00400c40(uStack_10 << 2); func_0x00400c10(uStack_18,&UNK_004013e8); printWLine(uStack_18); func_0x00400b80(uStack_18); } else { printLine(&UNK_00401400); } } return; }
['gcc']