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,900 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117397/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c_badSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401698);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401698);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004016b0);
}
return;
}
| ['gcc'] |
11,901 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117397/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c_goodG2BSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401768);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401768);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_00401780);
}
return;
}
| ['gcc'] |
11,902 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117397/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_52c_goodB2GSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401768);
if ((uVar1 < param_1) && (param_1 < 100)) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401768);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004017b8);
}
return;
}
| ['gcc'] |
11,903 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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 listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_1c;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_18 = 0xffffffff;
iStack_14 = -1;
iStack_18 = func_0x00400e70(2,1,6);
if (iStack_18 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400e30(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400d00(iStack_14,auStack_58,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_58[iStack_1c] = 0;
uStack_10 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400d70(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400d70(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_badSink(uStack_10);
return;
}
| ['gcc'] |
11,904 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,905 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_badSink(param_1);
return;
}
| ['gcc'] |
11,906 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
11,907 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53b_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
11,908 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_badSink(param_1);
return;
}
| ['gcc'] |
11,909 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodG2BSink(param_1);
return;
}
| ['gcc'] |
11,910 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53c_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
11,911 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_badSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_004016b8);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_004016b8);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004016d0);
}
return;
}
| ['gcc'] |
11,912 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodG2BSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_004017a8);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_004017a8);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004017c0);
}
return;
}
| ['gcc'] |
11,913 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117398/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_53d_goodB2GSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_004017a8);
if ((uVar1 < param_1) && (param_1 < 100)) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_004017a8);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004017f8);
}
return;
}
| ['gcc'] |
11,914 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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 listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_1c;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_18 = 0xffffffff;
iStack_14 = -1;
iStack_18 = func_0x00400e70(2,1,6);
if (iStack_18 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400e30(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400d00(iStack_14,auStack_58,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_58[iStack_1c] = 0;
uStack_10 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400d70(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400d70(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_badSink(uStack_10);
return;
}
| ['gcc'] |
11,915 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,916 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_badSink(param_1);
return;
}
| ['gcc'] |
11,917 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
11,918 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54b_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
11,919 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_badSink(param_1);
return;
}
| ['gcc'] |
11,920 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodG2BSink(param_1);
return;
}
| ['gcc'] |
11,921 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54c_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
11,922 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_badSink(param_1);
return;
}
| ['gcc'] |
11,923 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodG2BSink(param_1);
return;
}
| ['gcc'] |
11,924 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54d_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
11,925 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_badSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_004016d8);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_004016d8);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004016f0);
}
return;
}
| ['gcc'] |
11,926 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodG2BSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_004017d8);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_004017d8);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004017f0);
}
return;
}
| ['gcc'] |
11,927 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117399/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_54e_goodB2GSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_004017d8);
if ((uVar1 < param_1) && (param_1 < 100)) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_004017d8);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_00401828);
}
return;
}
| ['gcc'] |
11,928 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61_bad()
{
size_t data;
/* Initialize data */
data = 0;
data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117400/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61_bad(void)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_badSource(0);
uVar2 = func_0x00400d50(&UNK_00401688);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401688);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004016a0);
}
return;
}
| ['gcc'] |
11,929 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117400/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,930 | size_t CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_badSource(size_t data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117400/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_badSource |
undefined8
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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_14;
int iStack_10;
int iStack_c;
iStack_10 = 0xffffffff;
iStack_c = -1;
iStack_10 = func_0x00400e70(2,1,6);
uStack_50 = param_1;
if (iStack_10 != -1) {
func_0x00400d60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_10,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400e30(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400d00(iStack_c,auStack_48,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_48[iStack_14] = 0;
uStack_50 = func_0x00400e40(auStack_48,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400d70(iStack_10);
}
if (iStack_c != -1) {
func_0x00400d70(iStack_c);
}
return uStack_50;
}
| ['gcc'] |
11,931 | size_t CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117400/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_goodG2BSource |
undefined8 CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_goodG2BSource(void)
{
return 0x14;
}
| ['gcc'] |
11,932 | size_t CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_goodB2GSource(size_t data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117400/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_61b_goodB2GSource |
undefined8
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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_14;
int iStack_10;
int iStack_c;
iStack_10 = 0xffffffff;
iStack_c = -1;
iStack_10 = func_0x00400e70(2,1,6);
uStack_50 = param_1;
if (iStack_10 != -1) {
func_0x00400d60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_10,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400e30(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400d00(iStack_c,auStack_48,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_48[iStack_14] = 0;
uStack_50 = func_0x00400e40(auStack_48,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400d70(iStack_10);
}
if (iStack_c != -1) {
func_0x00400d70(iStack_c);
}
return uStack_50;
}
| ['gcc'] |
11,933 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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 listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_badSink(&data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117402/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined8 uStack_20;
int iStack_14;
int iStack_10;
int iStack_c;
uStack_20 = 0;
iStack_10 = 0xffffffff;
iStack_c = -1;
iStack_10 = func_0x00400e70(2,1,6);
if (iStack_10 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_10,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400e30(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400d00(iStack_c,auStack_58,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_58[iStack_14] = 0;
uStack_20 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400d70(iStack_10);
}
if (iStack_c != -1) {
func_0x00400d70(iStack_c);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_badSink(&uStack_20);
return;
}
| ['gcc'] |
11,934 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117402/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,935 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117402/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_badSink(ulong *param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *param_1;
uVar2 = func_0x00400d50(&UNK_00401688);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401688);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004016a0);
}
return;
}
| ['gcc'] |
11,936 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117402/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_goodG2BSink(ulong *param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *param_1;
uVar2 = func_0x00400d50(&UNK_00401748);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401748);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_00401760);
}
return;
}
| ['gcc'] |
11,937 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117402/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_63b_goodB2GSink(ulong *param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *param_1;
uVar2 = func_0x00400d50(&UNK_00401748);
if ((uVar2 < uVar1) && (uVar1 < 100)) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401748);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_00401798);
}
return;
}
| ['gcc'] |
11,938 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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 listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_badSink(&data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117403/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined8 uStack_20;
int iStack_14;
int iStack_10;
int iStack_c;
uStack_20 = 0;
iStack_10 = 0xffffffff;
iStack_c = -1;
iStack_10 = func_0x00400e70(2,1,6);
if (iStack_10 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_10,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400e30(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400d00(iStack_c,auStack_58,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_58[iStack_14] = 0;
uStack_20 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400d70(iStack_10);
}
if (iStack_c != -1) {
func_0x00400d70(iStack_c);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_badSink(&uStack_20);
return;
}
| ['gcc'] |
11,939 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117403/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,940 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117403/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_badSink(ulong *param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *param_1;
uVar2 = func_0x00400d50(&UNK_00401698);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401698);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004016b0);
}
return;
}
| ['gcc'] |
11,941 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117403/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_goodG2BSink(ulong *param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *param_1;
uVar2 = func_0x00400d50(&UNK_00401758);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401758);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_00401770);
}
return;
}
| ['gcc'] |
11,942 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117403/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_64b_goodB2GSink(ulong *param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *param_1;
uVar2 = func_0x00400d50(&UNK_00401758);
if ((uVar2 < uVar1) && (uVar1 < 100)) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401758);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004017a8);
}
return;
}
| ['gcc'] |
11,943 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65_bad()
{
size_t data;
/* define a function pointer */
void (*funcPtr) (size_t) = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_badSink;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117404/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_28;
int iStack_24;
code *pcStack_20;
int iStack_14;
undefined8 uStack_10;
pcStack_20 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_badSink;
uStack_10 = 0;
iStack_24 = 0xffffffff;
iStack_14 = -1;
iStack_24 = func_0x00400e70(2,1,6);
if (iStack_24 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_24,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_24,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400e30(iStack_24,0,0), iStack_14 != -1)) &&
((iStack_28 = func_0x00400d00(iStack_14,auStack_58,0x19,0), iStack_28 != -1 &&
(iStack_28 != 0)))) {
auStack_58[iStack_28] = 0;
uStack_10 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_24 != -1) {
func_0x00400d70(iStack_24);
}
if (iStack_14 != -1) {
func_0x00400d70(iStack_14);
}
(*pcStack_20)(uStack_10);
return;
}
| ['gcc'] |
11,944 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117404/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,945 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117404/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_badSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401688);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401688);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004016a0);
}
return;
}
| ['gcc'] |
11,946 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117404/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_goodG2BSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401748);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401748);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_00401760);
}
return;
}
| ['gcc'] |
11,947 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117404/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_65b_goodB2GSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401748);
if ((uVar1 < param_1) && (param_1 < 100)) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401748);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_00401798);
}
return;
}
| ['gcc'] |
11,948 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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 listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* put data in array */
dataArray[2] = data;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_badSink(dataArray);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117405/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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_1c;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_18 = 0xffffffff;
iStack_14 = -1;
iStack_18 = func_0x00400e70(2,1,6);
if (iStack_18 != -1) {
func_0x00400d60(&uStack_58,0,0x10);
uStack_58 = 2;
uStack_54 = 0;
uStack_56 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_18,&uStack_58,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400e30(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400d00(iStack_14,auStack_78,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_78[iStack_1c] = 0;
uStack_10 = func_0x00400e40(auStack_78,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400d70(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400d70(iStack_14);
}
uStack_38 = uStack_10;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_badSink(auStack_48);
return;
}
| ['gcc'] |
11,949 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117405/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,950 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117405/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_badSink(long param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *(ulong *)(param_1 + 0x10);
uVar2 = func_0x00400d50(&UNK_00401698);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401698);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004016b0);
}
return;
}
| ['gcc'] |
11,951 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117405/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_goodG2BSink(long param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *(ulong *)(param_1 + 0x10);
uVar2 = func_0x00400d50(&UNK_00401758);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401758);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_00401770);
}
return;
}
| ['gcc'] |
11,952 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117405/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_66b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = *(ulong *)(param_1 + 0x10);
uVar2 = func_0x00400d50(&UNK_00401758);
if ((uVar2 < uVar1) && (uVar1 < 100)) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401758);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004017a8);
}
return;
}
| ['gcc'] |
11,953 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_bad()
{
size_t data;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_structType myStruct;
/* Initialize data */
data = 0;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myStruct.structFirst = data;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_badSink(myStruct);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117406/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined8 uStack_28;
int iStack_1c;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_18 = 0xffffffff;
iStack_14 = -1;
iStack_18 = func_0x00400e70(2,1,6);
if (iStack_18 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400e30(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400d00(iStack_14,auStack_58,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_58[iStack_1c] = 0;
uStack_10 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400d70(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400d70(iStack_14);
}
uStack_28 = uStack_10;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_badSink(uStack_10);
return;
}
| ['gcc'] |
11,954 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117406/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,955 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_badSink(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117406/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_badSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401698);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401698);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004016b0);
}
return;
}
| ['gcc'] |
11,956 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_goodG2BSink(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117406/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_goodG2BSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401758);
if (uVar1 < param_1) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401758);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_00401770);
}
return;
}
| ['gcc'] |
11,957 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_goodB2GSink(CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117406/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_67b_goodB2GSink(ulong param_1)
{
ulong uVar1;
undefined8 uVar2;
uVar1 = func_0x00400d50(&UNK_00401758);
if ((uVar1 < param_1) && (param_1 < 100)) {
uVar2 = func_0x00400de0(param_1 << 2);
func_0x00400db0(uVar2,&UNK_00401758);
printWLine(uVar2);
func_0x00400cf0(uVar2);
}
else {
printLine(&UNK_004017a8);
}
return;
}
| ['gcc'] |
11,958 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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 listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
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 (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_badData = data;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_badSink();
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* 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/117407/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_bad(void)
{
int iVar1;
undefined auStack_58 [32];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_1c;
int iStack_18;
int iStack_14;
undefined8 uStack_10;
uStack_10 = 0;
iStack_18 = 0xffffffff;
iStack_14 = -1;
iStack_18 = func_0x00400e70(2,1,6);
if (iStack_18 != -1) {
func_0x00400d60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400d30(0x6987);
iVar1 = func_0x00400e20(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400e10(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400e30(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400d00(iStack_14,auStack_58,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_58[iStack_1c] = 0;
uStack_10 = func_0x00400e40(auStack_58,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400d70(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400d70(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_badData = uStack_10;
CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_badSink();
return;
}
| ['gcc'] |
11,959 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117407/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,960 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_badSink()
{
size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117407/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_badSink(void)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_badData;
uVar2 = func_0x00400d50(&UNK_00401698);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401698);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004016b0);
}
return;
}
| ['gcc'] |
11,961 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_goodG2BSink()
{
size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117407/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_goodG2BSink(void)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_goodG2BData;
uVar2 = func_0x00400d50(&UNK_00401758);
if (uVar2 < uVar1) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401758);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_00401770);
}
return;
}
| ['gcc'] |
11,962 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_goodB2GSink()
{
size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_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/117407/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68b_goodB2GSink(void)
{
ulong uVar1;
ulong uVar2;
undefined8 uVar3;
uVar1 = CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_listen_socket_68_goodB2GData;
uVar2 = func_0x00400d50(&UNK_00401758);
if ((uVar2 < uVar1) && (uVar1 < 100)) {
uVar3 = func_0x00400de0(uVar1 << 2);
func_0x00400db0(uVar3,&UNK_00401758);
printWLine(uVar3);
func_0x00400cf0(uVar3);
}
else {
printLine(&UNK_004017a8);
}
return;
}
| ['gcc'] |
11,963 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
{
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: Set data to a random value */', '/* 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/117415/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401258);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401258);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401270);
}
return;
}
| ['gcc'] |
11,964 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117415/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_01_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,965 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(1)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(1)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117416/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401258);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401258);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401270);
}
return;
}
| ['gcc'] |
11,966 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117416/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_02_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,967 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(5==5)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(5==5)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117417/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401258);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401258);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401270);
}
return;
}
| ['gcc'] |
11,968 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117417/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_03_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,969 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(STATIC_CONST_TRUE)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(STATIC_CONST_TRUE)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117418/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401270);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401270);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401288);
}
return;
}
| ['gcc'] |
11,970 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117418/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_04_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,971 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticTrue)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(staticTrue)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117419/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
if (staticTrue != 0) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
if (staticTrue != 0) {
uVar2 = func_0x00400ad0(&UNK_00401268);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401268);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401280);
}
}
return;
}
| ['gcc'] |
11,972 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117419/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_05_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,973 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(STATIC_CONST_FIVE==5)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(STATIC_CONST_FIVE==5)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117420/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_0040126c);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_0040126c);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401288);
}
return;
}
| ['gcc'] |
11,974 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117420/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,975 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticFive==5)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(staticFive==5)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117421/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
if (staticFive == 5) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
if (staticFive == 5) {
uVar2 = func_0x00400ad0(&UNK_00401278);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401278);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401290);
}
}
return;
}
| ['gcc'] |
11,976 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117421/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,977 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticReturnsTrue())
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(staticReturnsTrue())
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117422/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uVar2 = func_0x00400ad0(&UNK_00401288);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401288);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_004012a0);
}
}
return;
}
| ['gcc'] |
11,978 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117422/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,979 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_TRUE)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(GLOBAL_CONST_TRUE)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117423/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
if (GLOBAL_CONST_TRUE != 0) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
if (GLOBAL_CONST_TRUE != 0) {
uVar2 = func_0x00400ad0(&UNK_00401268);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401268);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401280);
}
}
return;
}
| ['gcc'] |
11,980 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117423/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,981 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalTrue)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
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: Set data to a random value */', '/* 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/117424/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
if (globalTrue != 0) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
if (globalTrue != 0) {
uVar2 = func_0x00400ad0(&UNK_00401268);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401268);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401280);
}
}
return;
}
| ['gcc'] |
11,982 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117424/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,983 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalReturnsTrue())
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
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: Set data to a random value */', '/* 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/117425/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uVar2 = func_0x00400ad0(&UNK_00401278);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401278);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401290);
}
}
return;
}
| ['gcc'] |
11,984 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117425/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_11_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,985 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalReturnsTrueOrFalse())
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
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: Set data to a random value */', '/* 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/117426/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_10 = 0x14;
}
else {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uVar2 = func_0x00400ad0(&UNK_004012e8);
if ((uVar2 < uStack_10) && (uStack_10 < 100)) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_004012e8);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401338);
}
}
else {
uVar2 = func_0x00400ad0(&UNK_004012e8);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_004012e8);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401300);
}
}
return;
}
| ['gcc'] |
11,986 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117426/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_12_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,987 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(GLOBAL_CONST_FIVE==5)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
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: Set data to a random value */', '/* 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/117427/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
if (GLOBAL_CONST_FIVE == 5) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
if (GLOBAL_CONST_FIVE == 5) {
uVar2 = func_0x00400ad0(&UNK_00401278);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401278);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401290);
}
}
return;
}
| ['gcc'] |
11,988 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117427/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_13_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,989 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalFive==5)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
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: Set data to a random value */', '/* 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/117428/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_10;
uStack_10 = 0;
if (globalFive == 5) {
iVar1 = func_0x00400b70();
uStack_10 = (ulong)iVar1;
}
if (globalFive == 5) {
uVar2 = func_0x00400ad0(&UNK_00401278);
if (uVar2 < uStack_10) {
uVar3 = func_0x00400b40(uStack_10 << 2);
func_0x00400b10(uVar3,&UNK_00401278);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401290);
}
}
return;
}
| ['gcc'] |
11,990 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117428/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_14_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,991 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15_bad()
{
size_t data;
/* Initialize data */
data = 0;
switch(6)
{
case 6:
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
switch(7)
{
case 7:
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the wcscpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117429/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401258);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401258);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401270);
}
return;
}
| ['gcc'] |
11,992 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117429/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_15_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,993 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16_bad()
{
size_t data;
/* Initialize data */
data = 0;
while(1)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
break;
}
while(1)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117430/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401258);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401258);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401270);
}
return;
}
| ['gcc'] |
11,994 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117430/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_16_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,995 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17_bad()
{
int i,j;
size_t data;
/* Initialize data */
data = 0;
for(i = 0; i < 1; i++)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
for(j = 0; j < 1; j++)
{
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117431/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
ulong uStack_18;
int iStack_10;
int iStack_c;
uStack_18 = 0;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
iVar1 = func_0x00400b70();
uStack_18 = (ulong)iVar1;
}
for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) {
uVar2 = func_0x00400ad0(&UNK_00401288);
if (uVar2 < uStack_18) {
uVar3 = func_0x00400b40(uStack_18 << 2);
func_0x00400b10(uVar3,&UNK_00401288);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_004012a0);
}
}
return;
}
| ['gcc'] |
11,996 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117431/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_17_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,997 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18_bad()
{
size_t data;
/* Initialize data */
data = 0;
goto source;
source:
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
goto sink;
sink:
{
wchar_t * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the wcscpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > wcslen(HELLO_STRING))
{
myString = (wchar_t *)malloc(data*sizeof(wchar_t));
/* Copy a small string into myString */
wcscpy(myString, HELLO_STRING);
printWLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* 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/117432/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18_bad(void)
{
int iVar1;
ulong uVar2;
undefined8 uVar3;
iVar1 = func_0x00400b70();
uVar2 = func_0x00400ad0(&UNK_00401258);
if (uVar2 < (ulong)(long)iVar1) {
uVar3 = func_0x00400b40((long)iVar1 << 2);
func_0x00400b10(uVar3,&UNK_00401258);
printWLine(uVar3);
func_0x00400a90(uVar3);
}
else {
printLine(&UNK_00401270);
}
return;
}
| ['gcc'] |
11,998 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117432/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_18_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,999 | void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_21_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
badStatic = 1; /* true */
badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* true */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117433/CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_21.c | CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_21_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_wchar_t_rand_21_bad(void)
{
int iVar1;
iVar1 = func_0x00400b70();
badStatic = 1;
badSink((long)iVar1);
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.