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
7,100
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_17_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110328/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_17.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_17_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_17_good(void) { goodG2B(); return; }
['gcc']
7,101
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18_bad() { int data; /* Initialize data */ data = -1; goto source; source: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110329/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined4 *puStack_28; int iStack_20; int iStack_1c; ulong uStack_18; int iStack_c; iStack_c = -1; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401534); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_46,0xd,0), iStack_20 != -1) ) && (iStack_20 != 0)) { auStack_46[iStack_20] = 0; iStack_c = func_0x00400d50(auStack_46); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } puStack_28 = (undefined4 *)func_0x00400d20((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_28[uStack_18] = 0; } printIntLine(*puStack_28); func_0x00400c40(puStack_28); return; }
['gcc']
7,102
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110329/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_18_good(void) { goodG2B(); return; }
['gcc']
7,103
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21_bad() { int data; /* Initialize data */ data = -1; badStatic = 1; /* true */ data = badSource(data); { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* true */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110330/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21_bad(void) { int iVar1; undefined4 *puVar2; ulong uStack_10; badStatic = 1; iVar1 = badSource(0xffffffff); puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,104
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110330/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_21_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,105
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_bad() { int data; /* Initialize data */ data = -1; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badGlobal = 1; /* true */ data = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badSource(data); { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* true */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110331/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_bad(void) { int iVar1; undefined4 *puVar2; ulong uStack_10; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badGlobal = 1; iVar1 = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badSource(0xffffffff) ; puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,106
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110331/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,107
int CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badSource(int data) { if(CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badGlobal) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110331/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badSource
undefined4 CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badSource(undefined4 param_1) { int iVar1; undefined4 uStack_3c; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_10; int iStack_c; uStack_3c = param_1; if (CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_badGlobal != 0) { iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401564); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_36,0xd,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_36[iStack_10] = 0; uStack_3c = func_0x00400d50(auStack_36); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } } return uStack_3c; }
['gcc']
7,108
int CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B1Source(int data) { if(CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Set data to a relatively small number greater than zero */ data = 20; } return data; }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Set data to a relatively small number greater than zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110331/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B1Source
undefined4 CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B1Source (undefined4 param_1) { undefined4 uStack_c; if (CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B1Global == 0) { uStack_c = 0x14; } else { printLine(&UNK_004012c4); uStack_c = param_1; } return uStack_c; }
['gcc']
7,109
int CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B2Source(int data) { if(CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B2Global) { /* FIX: Set data to a relatively small number greater than zero */ data = 20; } return data; }
['/* FIX: Set data to a relatively small number greater than zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110331/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B2Source
undefined4 CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B2Source (undefined4 param_1) { undefined4 uStack_c; uStack_c = param_1; if (CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_22_goodG2B2Global != 0) { uStack_c = 0x14; } return uStack_c; }
['gcc']
7,110
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { int dataCopy = data; int data = dataCopy; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110332/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31_bad(void) { int iVar1; undefined auStack_56 [14]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined4 *puStack_30; int iStack_28; int iStack_24; int iStack_20; int iStack_1c; ulong uStack_18; int iStack_c; iStack_c = -1; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = func_0x00400cf0(&UNK_00401544); uStack_46 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_48,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_56,0xd,0), iStack_20 != -1) ) && (iStack_20 != 0)) { auStack_56[iStack_20] = 0; iStack_c = func_0x00400d50(auStack_56); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } iStack_24 = iStack_c; iStack_28 = iStack_c; puStack_30 = (undefined4 *)func_0x00400d20((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_28; uStack_18 = uStack_18 + 1) { puStack_30[uStack_18] = 0; } printIntLine(*puStack_30); func_0x00400c40(puStack_30); return; }
['gcc']
7,111
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110332/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_31_good(void) { goodG2B(); return; }
['gcc']
7,112
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32_bad() { int data; int *dataPtr1 = &data; int *dataPtr2 = &data; /* Initialize data */ data = -1; { int data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { int data = *dataPtr2; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110333/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32_bad(void) { int iVar1; undefined auStack_66 [14]; undefined2 uStack_58; undefined2 uStack_56; undefined4 uStack_54; int iStack_44; undefined4 *puStack_40; int iStack_34; int iStack_30; int iStack_2c; int *piStack_28; int *piStack_20; ulong uStack_18; int iStack_c; piStack_20 = &iStack_44; piStack_28 = &iStack_44; iStack_44 = -1; iStack_c = -1; iStack_2c = 0xffffffff; iStack_2c = func_0x00400d90(2,1,6); if (iStack_2c != -1) { func_0x00400ca0(&uStack_58,0,0x10); uStack_58 = 2; uStack_54 = func_0x00400cf0(&UNK_00401564); uStack_56 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_2c,&uStack_58,0x10); if (((iVar1 != -1) && (iStack_30 = func_0x00400c50(iStack_2c,auStack_66,0xd,0), iStack_30 != -1) ) && (iStack_30 != 0)) { auStack_66[iStack_30] = 0; iStack_c = func_0x00400d50(auStack_66); } } if (iStack_2c != -1) { func_0x00400cb0(iStack_2c); } *piStack_20 = iStack_c; iStack_34 = *piStack_28; puStack_40 = (undefined4 *)func_0x00400d20((long)iStack_34 << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_34; uStack_18 = uStack_18 + 1) { puStack_40[uStack_18] = 0; } printIntLine(*puStack_40); func_0x00400c40(puStack_40); return; }
['gcc']
7,113
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110333/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_32_good(void) { goodG2B(); return; }
['gcc']
7,114
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_bad() { int data; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_unionType myUnion; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { int data = myUnion.unionSecond; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110335/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_bad(void) { int iVar1; undefined auStack_56 [14]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; int iStack_34; undefined4 *puStack_30; int iStack_24; int iStack_20; int iStack_1c; ulong uStack_18; int iStack_c; iStack_c = -1; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = func_0x00400cf0(&UNK_00401544); uStack_46 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_48,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_56,0xd,0), iStack_20 != -1) ) && (iStack_20 != 0)) { auStack_56[iStack_20] = 0; iStack_c = func_0x00400d50(auStack_56); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } iStack_34 = iStack_c; iStack_24 = iStack_c; puStack_30 = (undefined4 *)func_0x00400d20((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_24; uStack_18 = uStack_18 + 1) { puStack_30[uStack_18] = 0; } printIntLine(*puStack_30); func_0x00400c40(puStack_30); return; }
['gcc']
7,115
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110335/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_34_good(void) { goodG2B(); return; }
['gcc']
7,116
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_badSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110336/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,117
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110336/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401544); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_badSink(uStack_c); return; }
['gcc']
7,118
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_goodG2BSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110336/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,119
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110336/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_41_good(void) { goodG2B(); return; }
['gcc']
7,120
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42_bad() { int data; /* Initialize data */ data = -1; data = badSource(data); { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110337/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42_bad(void) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = badSource(0xffffffff); puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,121
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110337/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_42_good(void) { goodG2B(); return; }
['gcc']
7,122
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44_bad() { int data; /* define a function pointer */ void (*funcPtr) (int) = badSink; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* use the function pointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110339/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; undefined4 uStack_c; pcStack_18 = badSink; uStack_c = 0xffffffff; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401554); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_46,0xd,0), iStack_20 != -1) ) && (iStack_20 != 0)) { auStack_46[iStack_20] = 0; uStack_c = func_0x00400d50(auStack_46); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } (*pcStack_18)(uStack_c); return; }
['gcc']
7,123
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110339/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_44_good(void) { goodG2B(); return; }
['gcc']
7,124
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_badData = data; badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110340/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_badData = uStack_c; badSink(); return; }
['gcc']
7,125
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110340/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_45_good(void) { goodG2B(); return; }
['gcc']
7,126
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110341/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401544); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_badSink(uStack_c); return; }
['gcc']
7,127
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110341/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51_good(void) { goodG2B(); return; }
['gcc']
7,128
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_badSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110341/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,129
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_goodG2BSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110341/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_51b_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,130
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110342/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401564); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_badSink(uStack_c); return; }
['gcc']
7,131
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110342/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52_good(void) { goodG2B(); return; }
['gcc']
7,132
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_badSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_badSink(data); }
[]
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110342/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_badSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_badSink(param_1); return; }
['gcc']
7,133
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_goodG2BSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110342/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52b_goodG2BSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_goodG2BSink(param_1); return; }
['gcc']
7,134
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_badSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110342/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,135
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_goodG2BSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110342/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_52c_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,136
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401574); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_badSink(uStack_c); return; }
['gcc']
7,137
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53_good(void) { goodG2B(); return; }
['gcc']
7,138
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_badSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_badSink(data); }
[]
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_badSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_badSink(param_1); return; }
['gcc']
7,139
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_goodG2BSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53b_goodG2BSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_goodG2BSink(param_1); return; }
['gcc']
7,140
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_badSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_badSink(data); }
[]
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_badSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_badSink(param_1); return; }
['gcc']
7,141
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_goodG2BSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53c_goodG2BSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_goodG2BSink(param_1); return; }
['gcc']
7,142
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_badSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,143
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_goodG2BSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110343/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_53d_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,144
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401594); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_badSink(uStack_c); return; }
['gcc']
7,145
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54_good(void) { goodG2B(); return; }
['gcc']
7,146
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_badSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_badSink(data); }
[]
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_badSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_badSink(param_1); return; }
['gcc']
7,147
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_goodG2BSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54b_goodG2BSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_goodG2BSink(param_1); return; }
['gcc']
7,148
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_badSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_badSink(data); }
[]
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_badSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_badSink(param_1); return; }
['gcc']
7,149
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_goodG2BSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54c_goodG2BSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_goodG2BSink(param_1); return; }
['gcc']
7,150
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_badSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_badSink(data); }
[]
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_badSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_badSink(param_1); return; }
['gcc']
7,151
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_goodG2BSink(int data) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54d_goodG2BSink (undefined4 param_1) { CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_goodG2BSink(param_1); return; }
['gcc']
7,152
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_badSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,153
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_goodG2BSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110344/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_54e_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,154
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61_bad() { int data; /* Initialize data */ data = -1; data = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_badSource(data); { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110345/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61_bad(void) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_badSource (0xffffffff); puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,155
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110345/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61_good(void) { goodG2B(); return; }
['gcc']
7,156
int CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_badSource(int data) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110345/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_badSource
undefined4 CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_badSource(undefined4 param_1) { int iVar1; undefined4 uStack_3c; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_10; int iStack_c; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); uStack_3c = param_1; if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_36,0xd,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_36[iStack_10] = 0; uStack_3c = func_0x00400d50(auStack_36); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } return uStack_3c; }
['gcc']
7,157
int CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_goodG2BSource(int data) { /* FIX: Set data to a relatively small number greater than zero */ data = 20; return data; }
['/* FIX: Set data to a relatively small number greater than zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110345/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_goodG2BSource
undefined4 CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_61b_goodG2BSource(void) { return 0x14; }
['gcc']
7,158
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110347/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined4 uStack_14; int iStack_10; int iStack_c; uStack_14 = 0xffffffff; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_36,0xd,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_36[iStack_10] = 0; uStack_14 = func_0x00400d50(auStack_36); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_badSink(&uStack_14); return; }
['gcc']
7,159
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110347/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63_good(void) { goodG2B(); return; }
['gcc']
7,160
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_badSink(int * dataPtr) { int data = *dataPtr; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110347/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_badSink(int *param_1) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = *param_1; puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,161
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_goodG2BSink(int * dataPtr) { int data = *dataPtr; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110347/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_63b_goodG2BSink(int *param_1) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = *param_1; puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400a20(puVar2); return; }
['gcc']
7,162
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110348/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined4 uStack_14; int iStack_10; int iStack_c; uStack_14 = 0xffffffff; iStack_c = 0xffffffff; iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401564); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c50(iStack_c,auStack_36,0xd,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_36[iStack_10] = 0; uStack_14 = func_0x00400d50(auStack_36); } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_badSink(&uStack_14); return; }
['gcc']
7,163
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110348/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64_good(void) { goodG2B(); return; }
['gcc']
7,164
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int * dataPtr = (int *)dataVoidPtr; /* dereference dataPtr into data */ int data = (*dataPtr); { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110348/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_badSink(int *param_1) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = *param_1; puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,165
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ int * dataPtr = (int *)dataVoidPtr; /* dereference dataPtr into data */ int data = (*dataPtr); { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110348/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_64b_goodG2BSink(int *param_1) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = *param_1; puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400a20(puVar2); return; }
['gcc']
7,166
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65_bad() { int data; /* define a function pointer */ void (*funcPtr) (int) = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_badSink; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* use the function pointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110349/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; undefined4 uStack_c; pcStack_18 = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_badSink; uStack_c = 0xffffffff; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d90(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401554); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c50(iStack_1c,auStack_46,0xd,0), iStack_20 != -1) ) && (iStack_20 != 0)) { auStack_46[iStack_20] = 0; uStack_c = func_0x00400d50(auStack_46); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } (*pcStack_18)(uStack_c); return; }
['gcc']
7,167
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110349/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65_good(void) { goodG2B(); return; }
['gcc']
7,168
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_badSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110349/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,169
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_goodG2BSink(int data) { { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110349/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_65b_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,170
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66_bad() { int data; int dataArray[5]; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* put data in array */ dataArray[2] = data; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_badSink(dataArray); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* put data in array */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110350/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined auStack_28 [8]; undefined4 uStack_20; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401564); uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_46[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_46); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_20 = uStack_c; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_badSink(auStack_28); return; }
['gcc']
7,171
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110350/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66_good(void) { goodG2B(); return; }
['gcc']
7,172
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_badSink(int dataArray[]) { /* copy data out of dataArray */ int data = dataArray[2]; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* copy data out of dataArray */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110350/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_badSink(long param_1) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = *(int *)(param_1 + 8); puVar2 = (undefined4 *)func_0x00400d20((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,173
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_goodG2BSink(int dataArray[]) { int data = dataArray[2]; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110350/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_66b_goodG2BSink(long param_1) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = *(int *)(param_1 + 8); puVar2 = (undefined4 *)func_0x00400ab0((long)iVar1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400a20(puVar2); return; }
['gcc']
7,174
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_bad() { int data; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_structType myStruct; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myStruct.structFirst = data; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_badSink(myStruct); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110351/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined4 uStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_18 = uStack_c; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_badSink(uStack_c); return; }
['gcc']
7,175
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110351/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_good(void) { goodG2B(); return; }
['gcc']
7,176
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_badSink(CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_structType myStruct) { int data = myStruct.structFirst; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110351/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_badSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400d20((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400c40(puVar1); return; }
['gcc']
7,177
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_goodG2BSink(CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67_structType myStruct) { int data = myStruct.structFirst; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110351/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_67b_goodG2BSink(int param_1) { undefined4 *puVar1; ulong uStack_10; puVar1 = (undefined4 *)func_0x00400ab0((long)param_1 << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) { puVar1[uStack_10] = 0; } printIntLine(*puVar1); func_0x00400a20(puVar1); return; }
['gcc']
7,178
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a connect socket */ connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_badData = data; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110352/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d90(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cf0(&UNK_00401554); uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d60(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_36[iStack_14] = 0; uStack_c = func_0x00400d50(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_badData = uStack_c; CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_badSink(); return; }
['gcc']
7,179
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110352/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68a.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_good(void) { goodG2B(); return; }
['gcc']
7,180
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_badSink() { int data = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_badData; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110352/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_badSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_badSink(void) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_badData; puVar2 = (undefined4 *) func_0x00400d20((long) CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_badData << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400c40(puVar2); return; }
['gcc']
7,181
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_goodG2BSink() { int data = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_goodG2BData; { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110352/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_goodG2BSink
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68b_goodG2BSink(void) { int iVar1; undefined4 *puVar2; ulong uStack_10; iVar1 = CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_goodG2BData; puVar2 = (undefined4 *) func_0x00400ab0((long) CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_connect_socket_68_goodG2BData << 2); for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) { puVar2[uStack_10] = 0; } printIntLine(*puVar2); func_0x00400a20(puVar2); return; }
['gcc']
7,182
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01_bad() { int data; /* Initialize data */ data = -1; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110360/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401324); } else { iStack_c = func_0x00400be0(&uStack_2e); } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,183
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110360/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_01_good(void) { goodG2B(); return; }
['gcc']
7,184
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02_bad() { int data; /* Initialize data */ data = -1; if(1) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110361/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401324); } else { iStack_c = func_0x00400be0(&uStack_2e); } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,185
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110361/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_02_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,186
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03_bad() { int data; /* Initialize data */ data = -1; if(5==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110362/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401324); } else { iStack_c = func_0x00400be0(&uStack_2e); } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,187
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110362/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,188
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04_bad() { int data; /* Initialize data */ data = -1; if(STATIC_CONST_TRUE) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110363/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_0040132c); } else { iStack_c = func_0x00400be0(&uStack_2e); } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,189
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110363/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,190
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05_bad() { int data; /* Initialize data */ data = -1; if(staticTrue) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110364/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; if (staticTrue != 0) { uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401324); } else { iStack_c = func_0x00400be0(&uStack_2e); } } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,191
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110364/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,192
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06_bad() { int data; /* Initialize data */ data = -1; if(STATIC_CONST_FIVE==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110365/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401328); } else { iStack_c = func_0x00400be0(&uStack_2e); } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,193
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110365/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_06_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,194
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07_bad() { int data; /* Initialize data */ data = -1; if(staticFive==5) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110366/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; if (staticFive == 5) { uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401324); } else { iStack_c = func_0x00400be0(&uStack_2e); } } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,195
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110366/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_07_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,196
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08_bad() { int data; /* Initialize data */ data = -1; if(staticReturnsTrue()) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110367/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08_bad(void) { int iVar1; long lVar2; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar2 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar2 == 0) { printLine(&UNK_00401344); } else { iStack_c = func_0x00400be0(&uStack_2e); } } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,197
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110367/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_08_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
7,198
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09_bad() { int data; /* Initialize data */ data = -1; if(GLOBAL_CONST_TRUE) { { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } } { size_t i; int *intPointer; /* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value * so that the for loop doing the initialization causes a buffer overflow */ intPointer = (int*)malloc(data * sizeof(int)); for (i = 0; i < (size_t)data; i++) { intPointer[i] = 0; /* Potentially writes beyond the boundary of intPointer */ } printIntLine(intPointer[0]); free(intPointer); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: if data * sizeof(int) > SIZE_MAX, overflows to a small value\r\n * so that the for loop doing the initialization causes a buffer overflow */', '/* Potentially writes beyond the boundary of intPointer */']
['CWE680']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110368/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09_bad
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09_bad(void) { long lVar1; undefined8 uStack_2e; undefined4 uStack_26; undefined2 uStack_22; undefined4 *puStack_20; ulong uStack_18; int iStack_c; iStack_c = -1; if (GLOBAL_CONST_TRUE != 0) { uStack_2e = 0; uStack_26 = 0; uStack_22 = 0; lVar1 = func_0x00400b70(&uStack_2e,0xe,stdin); if (lVar1 == 0) { printLine(&UNK_00401324); } else { iStack_c = func_0x00400be0(&uStack_2e); } } puStack_20 = (undefined4 *)func_0x00400bb0((long)iStack_c << 2); for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) { puStack_20[uStack_18] = 0; } printIntLine(*puStack_20); func_0x00400b10(puStack_20); return; }
['gcc']
7,199
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/110368/CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09.c
CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09_good
void CWE680_Integer_Overflow_to_Buffer_Overflow__malloc_fgets_09_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']