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,300 | size_t CWE789_Uncontrolled_Mem_Alloc__malloc_char_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/117160/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_61b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_61b_goodB2GSource |
undefined8
CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_0x00400dd0(2,1,6);
uStack_50 = param_1;
if (iStack_10 != -1) {
func_0x00400cd0(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_10,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400c80(iStack_c,auStack_48,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_48[iStack_14] = 0;
uStack_50 = func_0x00400da0(auStack_48,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
return uStack_50;
}
| ['gcc'] |
11,301 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_char_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/117162/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_0x00400dd0(2,1,6);
if (iStack_10 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_10,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400c80(iStack_c,auStack_58,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_58[iStack_14] = 0;
uStack_20 = func_0x00400da0(auStack_58,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_badSink(&uStack_20);
return;
}
| ['gcc'] |
11,302 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117162/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,303 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_badSink(size_t * dataPtr)
{
size_t data = *dataPtr;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117162/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_badSink(ulong *param_1)
{
undefined4 *puVar1;
if (*param_1 < 6) {
printLine(&UNK_004015d8);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(*param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,304 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_goodG2BSink(size_t * dataPtr)
{
size_t data = *dataPtr;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117162/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_goodG2BSink(ulong *param_1)
{
undefined4 *puVar1;
if (*param_1 < 6) {
printLine(&UNK_00401688);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(*param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,305 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_goodB2GSink(size_t * dataPtr)
{
size_t data = *dataPtr;
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117162/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_63b_goodB2GSink(ulong *param_1)
{
ulong uVar1;
undefined4 *puVar2;
uVar1 = *param_1;
if ((uVar1 < 6) || (99 < uVar1)) {
printLine(&UNK_004016c0);
}
else {
puVar2 = (undefined4 *)func_0x00400d40(uVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400c70(puVar2);
}
return;
}
| ['gcc'] |
11,306 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_char_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/117163/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_0x00400dd0(2,1,6);
if (iStack_10 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_10,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) &&
((iStack_14 = func_0x00400c80(iStack_c,auStack_58,0x19,0), iStack_14 != -1 &&
(iStack_14 != 0)))) {
auStack_58[iStack_14] = 0;
uStack_20 = func_0x00400da0(auStack_58,0,0);
}
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_badSink(&uStack_20);
return;
}
| ['gcc'] |
11,307 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117163/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,308 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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);
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117163/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_badSink(ulong *param_1)
{
undefined4 *puVar1;
if (*param_1 < 6) {
printLine(&UNK_004015e8);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(*param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,309 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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);
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117163/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_goodG2BSink(ulong *param_1)
{
undefined4 *puVar1;
if (*param_1 < 6) {
printLine(&UNK_00401698);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(*param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,310 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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);
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117163/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_64b_goodB2GSink(ulong *param_1)
{
ulong uVar1;
undefined4 *puVar2;
uVar1 = *param_1;
if ((uVar1 < 6) || (99 < uVar1)) {
printLine(&UNK_004016d0);
}
else {
puVar2 = (undefined4 *)func_0x00400d40(uVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400c70(puVar2);
}
return;
}
| ['gcc'] |
11,311 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65_bad()
{
size_t data;
/* define a function pointer */
void (*funcPtr) (size_t) = CWE789_Uncontrolled_Mem_Alloc__malloc_char_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/117164/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_char_listen_socket_65b_badSink;
uStack_10 = 0;
iStack_24 = 0xffffffff;
iStack_14 = -1;
iStack_24 = func_0x00400dd0(2,1,6);
if (iStack_24 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_24,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_24,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400d90(iStack_24,0,0), iStack_14 != -1)) &&
((iStack_28 = func_0x00400c80(iStack_14,auStack_58,0x19,0), iStack_28 != -1 &&
(iStack_28 != 0)))) {
auStack_58[iStack_28] = 0;
uStack_10 = func_0x00400da0(auStack_58,0,0);
}
}
if (iStack_24 != -1) {
func_0x00400ce0(iStack_24);
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
(*pcStack_20)(uStack_10);
return;
}
| ['gcc'] |
11,312 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117164/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,313 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_badSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117164/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_badSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_004015d8);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,314 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_goodG2BSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117164/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_00401688);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,315 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_goodB2GSink(size_t data)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117164/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_65b_goodB2GSink(ulong param_1)
{
undefined4 *puVar1;
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_004016c0);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,316 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_char_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/117165/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_0x00400dd0(2,1,6);
if (iStack_18 != -1) {
func_0x00400cd0(&uStack_58,0,0x10);
uStack_58 = 2;
uStack_54 = 0;
uStack_56 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_18,&uStack_58,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400d90(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400c80(iStack_14,auStack_78,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_78[iStack_1c] = 0;
uStack_10 = func_0x00400da0(auStack_78,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400ce0(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
uStack_38 = uStack_10;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_badSink(auStack_48);
return;
}
| ['gcc'] |
11,317 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117165/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,318 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_badSink(size_t dataArray[])
{
/* copy data out of dataArray */
size_t data = dataArray[2];
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* copy data out of dataArray */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117165/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_badSink(long param_1)
{
undefined4 *puVar1;
if (*(ulong *)(param_1 + 0x10) < 6) {
printLine(&UNK_004015e8);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(*(ulong *)(param_1 + 0x10));
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,319 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_goodG2BSink(size_t dataArray[])
{
size_t data = dataArray[2];
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117165/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_goodG2BSink(long param_1)
{
undefined4 *puVar1;
if (*(ulong *)(param_1 + 0x10) < 6) {
printLine(&UNK_004016a8);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(*(ulong *)(param_1 + 0x10));
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,320 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_goodB2GSink(size_t dataArray[])
{
size_t data = dataArray[2];
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117165/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_66b_goodB2GSink(long param_1)
{
ulong uVar1;
undefined4 *puVar2;
uVar1 = *(ulong *)(param_1 + 0x10);
if ((uVar1 < 6) || (99 < uVar1)) {
printLine(&UNK_004016e0);
}
else {
puVar2 = (undefined4 *)func_0x00400d40(uVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400c70(puVar2);
}
return;
}
| ['gcc'] |
11,321 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_bad()
{
size_t data;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_char_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/117166/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_0x00400dd0(2,1,6);
if (iStack_18 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400d90(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400c80(iStack_14,auStack_58,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_58[iStack_1c] = 0;
uStack_10 = func_0x00400da0(auStack_58,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400ce0(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
uStack_28 = uStack_10;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_badSink(uStack_10);
return;
}
| ['gcc'] |
11,322 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117166/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,323 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_badSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_structType myStruct)
{
size_t data = myStruct.structFirst;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117166/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_badSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_004015e8);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,324 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_goodG2BSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_structType myStruct)
{
size_t data = myStruct.structFirst;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117166/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_00401698);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,325 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_goodB2GSink(CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67_structType myStruct)
{
size_t data = myStruct.structFirst;
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117166/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_67b_goodB2GSink(ulong param_1)
{
undefined4 *puVar1;
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_004016d0);
}
else {
puVar1 = (undefined4 *)func_0x00400d40(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,326 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_char_listen_socket_68_badData = data;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_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/117167/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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_0x00400dd0(2,1,6);
if (iStack_18 != -1) {
func_0x00400cd0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cb0(0x6987);
iVar1 = func_0x00400d80(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_18,5), iVar1 != -1)) &&
(iStack_14 = func_0x00400d90(iStack_18,0,0), iStack_14 != -1)) &&
((iStack_1c = func_0x00400c80(iStack_14,auStack_58,0x19,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_58[iStack_1c] = 0;
uStack_10 = func_0x00400da0(auStack_58,0,0);
}
}
if (iStack_18 != -1) {
func_0x00400ce0(iStack_18);
}
if (iStack_14 != -1) {
func_0x00400ce0(iStack_14);
}
CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_badData = uStack_10;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_badSink();
return;
}
| ['gcc'] |
11,327 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117167/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,328 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_badSink()
{
size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_badData;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117167/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_badSink(void)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_badData < 6) {
printLine(&UNK_004015e8);
}
else {
puVar1 = (undefined4 *)
func_0x00400d40(CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_badData);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,329 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_goodG2BSink()
{
size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodG2BData;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117167/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_goodG2BSink(void)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodG2BData < 6) {
printLine(&UNK_00401698);
}
else {
puVar1 = (undefined4 *)
func_0x00400d40(CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodG2BData
);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,330 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_goodB2GSink()
{
size_t data = CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodB2GData;
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117167/CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68b_goodB2GSink(void)
{
undefined4 *puVar1;
if ((CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodB2GData < 6) ||
(99 < CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodB2GData)) {
printLine(&UNK_004016d0);
}
else {
puVar1 = (undefined4 *)
func_0x00400d40(CWE789_Uncontrolled_Mem_Alloc__malloc_char_listen_socket_68_goodB2GData
);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400c70(puVar1);
}
return;
}
| ['gcc'] |
11,331 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117175/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011b8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,332 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117175/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_01_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,333 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(1)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(1)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117176/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011b8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,334 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117176/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_02_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,335 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117177/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011b8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,336 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117177/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_03_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,337 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117178/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011d0);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,338 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117178/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_04_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,339 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticTrue)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(staticTrue)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117179/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
if (staticTrue != 0) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
if (staticTrue != 0) {
if (uStack_10 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,340 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117179/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_05_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,341 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117180/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011e0);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,342 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117180/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,343 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117181/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
if (staticFive == 5) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
if (staticFive == 5) {
if (uStack_10 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,344 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117181/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,345 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(staticReturnsTrue())
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(staticReturnsTrue())
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117182/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
if (uStack_10 < 6) {
printLine(&UNK_004011e8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,346 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117182/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,347 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117183/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
if (GLOBAL_CONST_TRUE != 0) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
if (GLOBAL_CONST_TRUE != 0) {
if (uStack_10 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,348 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117183/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,349 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10_bad()
{
size_t data;
/* Initialize data */
data = 0;
if(globalTrue)
{
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
}
if(globalTrue)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117184/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
if (globalTrue != 0) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
if (globalTrue != 0) {
if (uStack_10 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,350 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117184/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,351 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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())
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
else
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: 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 strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117186/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_10 = 0x14;
}
else {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
if ((uStack_10 < 6) || (99 < uStack_10)) {
printLine(&UNK_00401270);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
else if (uStack_10 < 6) {
printLine(&UNK_00401238);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,352 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117186/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_12_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,353 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117187/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
if (GLOBAL_CONST_FIVE == 5) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
if (GLOBAL_CONST_FIVE == 5) {
if (uStack_10 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,354 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117187/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_13_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,355 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117188/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14_bad(void)
{
int iVar1;
undefined4 *puVar2;
ulong uStack_10;
uStack_10 = 0;
if (globalFive == 5) {
iVar1 = func_0x00400ae0();
uStack_10 = (ulong)iVar1;
}
if (globalFive == 5) {
if (uStack_10 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_10);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,356 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117188/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_14_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,357 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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:
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: 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 strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117189/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011b8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,358 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117189/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_15_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
11,359 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117190/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011b8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,360 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117190/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_16_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,361 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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++)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117191/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17_bad(void)
{
int iVar1;
undefined4 *puVar2;
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_0x00400ae0();
uStack_18 = (ulong)iVar1;
}
for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) {
if (uStack_18 < 6) {
printLine(&UNK_004011e8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uStack_18);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
}
return;
}
| ['gcc'] |
11,362 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117191/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_17_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,363 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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:
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117192/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011b8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,364 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117192/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_18_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,365 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_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/117193/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
badStatic = 1;
badSink((long)iVar1);
return;
}
| ['gcc'] |
11,366 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21_good()
{
goodB2G1();
goodB2G2();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117193/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_21_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
| ['gcc'] |
11,367 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badGlobal = 1; /* true */
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_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/117194/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badGlobal = 1;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badSink((long)iVar1);
return;
}
| ['gcc'] |
11,368 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_good()
{
goodB2G1();
goodB2G2();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117194/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
| ['gcc'] |
11,369 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badSink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badGlobal)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117194/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badSink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_badGlobal != 0) {
if (param_1 < 6) {
printLine(&UNK_004011e8);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
}
return;
}
| ['gcc'] |
11,370 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G1Sink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117194/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G1Sink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G1Sink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G1Global == 0) {
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_00401370);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
}
else {
printLine(&UNK_00401358);
}
return;
}
| ['gcc'] |
11,371 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G2Sink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G2Global)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117194/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G2Sink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G2Sink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodB2G2Global != 0) {
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_00401370);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
}
return;
}
| ['gcc'] |
11,372 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodG2BSink(size_t data)
{
if(CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodG2BGlobal)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117194/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_22_goodG2BGlobal != 0) {
if (param_1 < 6) {
printLine(&UNK_004013b0);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
}
return;
}
| ['gcc'] |
11,373 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
{
size_t dataCopy = data;
size_t data = dataCopy;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117195/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011c8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,374 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117195/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_31_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,375 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32_bad()
{
size_t data;
size_t *dataPtr1 = &data;
size_t *dataPtr2 = &data;
/* Initialize data */
data = 0;
{
size_t data = *dataPtr1;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
*dataPtr1 = data;
}
{
size_t data = *dataPtr2;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117196/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32_bad |
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32_bad(void)
{
int iVar1;
ulong uStack_38;
undefined4 *puStack_30;
ulong uStack_28;
ulong uStack_20;
ulong *puStack_18;
ulong *puStack_10;
puStack_10 = &uStack_38;
puStack_18 = &uStack_38;
uStack_38 = 0;
uStack_20 = 0;
iVar1 = func_0x00400ae0();
uStack_20 = (ulong)iVar1;
*puStack_10 = uStack_20;
uStack_28 = *puStack_18;
if (uStack_28 < 6) {
printLine(&UNK_004011e8);
}
else {
puStack_30 = (undefined4 *)func_0x00400ab0(uStack_28);
*puStack_30 = 0x6c6c6568;
*(undefined2 *)(puStack_30 + 1) = 0x6f;
printLine(puStack_30);
func_0x00400a20(puStack_30);
}
return;
}
| ['gcc'] |
11,376 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117196/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_32_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,377 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_bad()
{
size_t data;
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_unionType myUnion;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
myUnion.unionFirst = data;
{
size_t data = myUnion.unionSecond;
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117198/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_bad(void)
{
int iVar1;
undefined4 *puVar2;
iVar1 = func_0x00400ae0();
if ((ulong)(long)iVar1 < 6) {
printLine(&UNK_004011c8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,378 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117198/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_34_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,379 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117199/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
badSink((long)iVar1);
return;
}
| ['gcc'] |
11,380 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117199/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_41_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,381 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42_bad()
{
size_t data;
/* Initialize data */
data = 0;
data = badSource(data);
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117200/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42_bad(void)
{
ulong uVar1;
undefined4 *puVar2;
uVar1 = badSource(0);
if (uVar1 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar2 = (undefined4 *)func_0x00400ab0(uVar1);
*puVar2 = 0x6c6c6568;
*(undefined2 *)(puVar2 + 1) = 0x6f;
printLine(puVar2);
func_0x00400a20(puVar2);
}
return;
}
| ['gcc'] |
11,382 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117200/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_42_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
11,383 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44_bad()
{
size_t data;
/* define a function pointer */
void (*funcPtr) (size_t) = badSink;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */', '/* use the function pointer */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117202/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
badSink((long)iVar1);
return;
}
| ['gcc'] |
11,384 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117202/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_44_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,385 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_badData = data;
badSink();
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117203/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_badData = (long)iVar1;
badSink();
return;
}
| ['gcc'] |
11,386 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117203/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_45_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,387 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117204/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_badSink((long)iVar1);
return;
}
| ['gcc'] |
11,388 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117204/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,389 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_badSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117204/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_badSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_004011d8);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
return;
}
| ['gcc'] |
11,390 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_goodG2BSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117204/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_00401278);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
return;
}
| ['gcc'] |
11,391 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_goodB2GSink(size_t data)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117204/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_51b_goodB2GSink(ulong param_1)
{
undefined4 *puVar1;
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_004012b0);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
return;
}
| ['gcc'] |
11,392 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52_bad()
{
size_t data;
/* Initialize data */
data = 0;
/* POTENTIAL FLAW: Set data to a random value */
data = rand();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Set data to a random value */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52_bad |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52_bad(void)
{
int iVar1;
iVar1 = func_0x00400ae0();
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_badSink((long)iVar1);
return;
}
| ['gcc'] |
11,393 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52a.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52_good |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
11,394 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_badSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_badSink(data);
} | [] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_badSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_badSink(param_1);
return;
}
| ['gcc'] |
11,395 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_goodG2BSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_goodG2BSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
11,396 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_goodB2GSink(size_t data)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52b_goodB2GSink(undefined8 param_1)
{
CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
11,397 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_badSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | ['CWE789'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_badSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_badSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_004011f8);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
return;
}
| ['gcc'] |
11,398 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodG2BSink(size_t data)
{
{
char * myString;
/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING))
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string");
}
}
} | ['/* POTENTIAL FLAW: No MAXIMUM limitation for memory allocation, but ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodG2BSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodG2BSink(ulong param_1)
{
undefined4 *puVar1;
if (param_1 < 6) {
printLine(&UNK_004012b8);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
return;
}
| ['gcc'] |
11,399 | void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodB2GSink(size_t data)
{
{
char * myString;
/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough
* for the strcpy() function to not cause a buffer overflow */
/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */
if (data > strlen(HELLO_STRING) && data < 100)
{
myString = (char *)malloc(data*sizeof(char));
/* Copy a small string into myString */
strcpy(myString, HELLO_STRING);
printLine(myString);
free(myString);
}
else
{
printLine("Input is less than the length of the source string or too large");
}
}
} | ['/* FIX: Include a MAXIMUM limitation for memory allocation and a check to ensure data is large enough\r\n * for the strcpy() function to not cause a buffer overflow */', '/* INCIDENTAL FLAW: The source could cause a type overrun in data or in the memory allocation */', '/* Copy a small string into myString */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/117205/CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c.c | CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodB2GSink |
void CWE789_Uncontrolled_Mem_Alloc__malloc_char_rand_52c_goodB2GSink(ulong param_1)
{
undefined4 *puVar1;
if ((param_1 < 6) || (99 < param_1)) {
printLine(&UNK_004012f0);
}
else {
puVar1 = (undefined4 *)func_0x00400ab0(param_1);
*puVar1 = 0x6c6c6568;
*(undefined2 *)(puVar1 + 1) = 0x6f;
printLine(puVar1);
func_0x00400a20(puVar1);
}
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.