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
4,900
void CWE605_Multiple_Binds_Same_Port__basic_06_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108917/CWE605_Multiple_Binds_Same_Port__basic_06.c
CWE605_Multiple_Binds_Same_Port__basic_06_good
void CWE605_Multiple_Binds_Same_Port__basic_06_good(void) { good1(); good2(); return; }
['gcc']
4,901
void CWE605_Multiple_Binds_Same_Port__basic_07_bad() { if(staticFive==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108918/CWE605_Multiple_Binds_Same_Port__basic_07.c
CWE605_Multiple_Binds_Same_Port__basic_07_bad
void CWE605_Multiple_Binds_Same_Port__basic_07_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; if (staticFive == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,902
void CWE605_Multiple_Binds_Same_Port__basic_07_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108918/CWE605_Multiple_Binds_Same_Port__basic_07.c
CWE605_Multiple_Binds_Same_Port__basic_07_good
void CWE605_Multiple_Binds_Same_Port__basic_07_good(void) { good1(); good2(); return; }
['gcc']
4,903
void CWE605_Multiple_Binds_Same_Port__basic_08_bad() { if(staticReturnsTrue()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108919/CWE605_Multiple_Binds_Same_Port__basic_08.c
CWE605_Multiple_Binds_Same_Port__basic_08_bad
void CWE605_Multiple_Binds_Same_Port__basic_08_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,904
void CWE605_Multiple_Binds_Same_Port__basic_08_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108919/CWE605_Multiple_Binds_Same_Port__basic_08.c
CWE605_Multiple_Binds_Same_Port__basic_08_good
void CWE605_Multiple_Binds_Same_Port__basic_08_good(void) { good1(); good2(); return; }
['gcc']
4,905
void CWE605_Multiple_Binds_Same_Port__basic_09_bad() { if(GLOBAL_CONST_TRUE) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108920/CWE605_Multiple_Binds_Same_Port__basic_09.c
CWE605_Multiple_Binds_Same_Port__basic_09_bad
void CWE605_Multiple_Binds_Same_Port__basic_09_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; if (GLOBAL_CONST_TRUE != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,906
void CWE605_Multiple_Binds_Same_Port__basic_09_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108920/CWE605_Multiple_Binds_Same_Port__basic_09.c
CWE605_Multiple_Binds_Same_Port__basic_09_good
void CWE605_Multiple_Binds_Same_Port__basic_09_good(void) { good1(); good2(); return; }
['gcc']
4,907
void CWE605_Multiple_Binds_Same_Port__basic_10_bad() { if(globalTrue) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108921/CWE605_Multiple_Binds_Same_Port__basic_10.c
CWE605_Multiple_Binds_Same_Port__basic_10_bad
void CWE605_Multiple_Binds_Same_Port__basic_10_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; if (globalTrue != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,908
void CWE605_Multiple_Binds_Same_Port__basic_10_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108921/CWE605_Multiple_Binds_Same_Port__basic_10.c
CWE605_Multiple_Binds_Same_Port__basic_10_good
void CWE605_Multiple_Binds_Same_Port__basic_10_good(void) { good1(); good2(); return; }
['gcc']
4,909
void CWE605_Multiple_Binds_Same_Port__basic_11_bad() { if(globalReturnsTrue()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108922/CWE605_Multiple_Binds_Same_Port__basic_11.c
CWE605_Multiple_Binds_Same_Port__basic_11_bad
void CWE605_Multiple_Binds_Same_Port__basic_11_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,910
void CWE605_Multiple_Binds_Same_Port__basic_11_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108922/CWE605_Multiple_Binds_Same_Port__basic_11.c
CWE605_Multiple_Binds_Same_Port__basic_11_good
void CWE605_Multiple_Binds_Same_Port__basic_11_good(void) { good1(); good2(); return; }
['gcc']
4,911
void CWE605_Multiple_Binds_Same_Port__basic_12_bad() { if(globalReturnsTrueOrFalse()) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } else { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FIX: Do not allow multiple binds to the same port */ memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FIX: Do not allow multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108923/CWE605_Multiple_Binds_Same_Port__basic_12.c
CWE605_Multiple_Binds_Same_Port__basic_12_bad
void CWE605_Multiple_Binds_Same_Port__basic_12_bad(void) { int iVar1; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined4 uStack_98; undefined2 uStack_88; undefined2 uStack_86; undefined4 uStack_84; undefined4 uStack_6c; undefined2 uStack_68; undefined2 uStack_66; undefined4 uStack_64; undefined *puStack_50; int iStack_48; undefined4 uStack_44; long lStack_40; int iStack_34; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; iStack_14 = 0xffffffff; iStack_10 = -1; lStack_20 = func_0x00400cc0(&uStack_f8); iStack_14 = func_0x00400de0(2,1,6); if (iStack_14 != -1) { func_0x00400d00(&uStack_88,0,0x10); uStack_88 = 2; uStack_84 = 0; uStack_86 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_14,&uStack_88,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d90(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400db0(iStack_14,0,0), iStack_10 != -1)) && ((iStack_24 = func_0x00400c80(iStack_10,(long)&uStack_f8 + lStack_20, (long)(99 - (int)lStack_20),0), iStack_24 != -1 && (iStack_24 != 0)))) { *(undefined *)((long)&uStack_f8 + (long)iStack_24) = 0; puStack_30 = (undefined *)func_0x00400ce0(&uStack_f8,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400ce0(&uStack_f8,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400d10(iStack_14); } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } printLine(&uStack_f8); } else { uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; iStack_34 = 0xffffffff; iStack_c = -1; lStack_40 = func_0x00400cc0(&uStack_f8); uStack_6c = 1; uStack_44 = 4; iStack_34 = func_0x00400de0(2,1,6); if ((iStack_34 != -1) && (iVar1 = func_0x00400ca0(iStack_34,1,2,&uStack_6c,uStack_44), iVar1 == 0)) { func_0x00400d00(&uStack_68,0,0x10); uStack_68 = 2; uStack_64 = 0; uStack_66 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_34,&uStack_68,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_34,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_34,0,0), iStack_c != -1)) && (iStack_48 = func_0x00400c80(iStack_c,(long)&uStack_f8 + lStack_40, (long)(99 - (int)lStack_40),0), iStack_48 != -1)))) && (iStack_48 != 0)) { *(undefined *)((long)&uStack_f8 + (long)iStack_48) = 0; puStack_50 = (undefined *)func_0x00400ce0(&uStack_f8,0xd); if (puStack_50 != (undefined *)0x0) { *puStack_50 = 0; } puStack_50 = (undefined *)func_0x00400ce0(&uStack_f8,10); if (puStack_50 != (undefined *)0x0) { *puStack_50 = 0; } } } if (iStack_34 != -1) { func_0x00400d10(iStack_34); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_f8); } return; }
['gcc']
4,912
void CWE605_Multiple_Binds_Same_Port__basic_12_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108923/CWE605_Multiple_Binds_Same_Port__basic_12.c
CWE605_Multiple_Binds_Same_Port__basic_12_good
void CWE605_Multiple_Binds_Same_Port__basic_12_good(void) { good1(); return; }
['gcc']
4,913
void CWE605_Multiple_Binds_Same_Port__basic_13_bad() { if(GLOBAL_CONST_FIVE==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108924/CWE605_Multiple_Binds_Same_Port__basic_13.c
CWE605_Multiple_Binds_Same_Port__basic_13_bad
void CWE605_Multiple_Binds_Same_Port__basic_13_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; if (GLOBAL_CONST_FIVE == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,914
void CWE605_Multiple_Binds_Same_Port__basic_13_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108924/CWE605_Multiple_Binds_Same_Port__basic_13.c
CWE605_Multiple_Binds_Same_Port__basic_13_good
void CWE605_Multiple_Binds_Same_Port__basic_13_good(void) { good1(); good2(); return; }
['gcc']
4,915
void CWE605_Multiple_Binds_Same_Port__basic_14_bad() { if(globalFive==5) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108925/CWE605_Multiple_Binds_Same_Port__basic_14.c
CWE605_Multiple_Binds_Same_Port__basic_14_bad
void CWE605_Multiple_Binds_Same_Port__basic_14_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; if (globalFive == 5) { uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0)) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); } return; }
['gcc']
4,916
void CWE605_Multiple_Binds_Same_Port__basic_14_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108925/CWE605_Multiple_Binds_Same_Port__basic_14.c
CWE605_Multiple_Binds_Same_Port__basic_14_good
void CWE605_Multiple_Binds_Same_Port__basic_14_good(void) { good1(); good2(); return; }
['gcc']
4,917
void CWE605_Multiple_Binds_Same_Port__basic_15_bad() { switch(6) { case 6: { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108926/CWE605_Multiple_Binds_Same_Port__basic_15.c
CWE605_Multiple_Binds_Same_Port__basic_15_bad
void CWE605_Multiple_Binds_Same_Port__basic_15_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0) ) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
4,918
void CWE605_Multiple_Binds_Same_Port__basic_15_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108926/CWE605_Multiple_Binds_Same_Port__basic_15.c
CWE605_Multiple_Binds_Same_Port__basic_15_good
void CWE605_Multiple_Binds_Same_Port__basic_15_good(void) { good1(); good2(); return; }
['gcc']
4,919
void CWE605_Multiple_Binds_Same_Port__basic_16_bad() { while(1) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } break; } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108927/CWE605_Multiple_Binds_Same_Port__basic_16.c
CWE605_Multiple_Binds_Same_Port__basic_16_bad
void CWE605_Multiple_Binds_Same_Port__basic_16_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0) ) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
4,920
void CWE605_Multiple_Binds_Same_Port__basic_16_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108927/CWE605_Multiple_Binds_Same_Port__basic_16.c
CWE605_Multiple_Binds_Same_Port__basic_16_good
void CWE605_Multiple_Binds_Same_Port__basic_16_good(void) { good1(); return; }
['gcc']
4,921
void CWE605_Multiple_Binds_Same_Port__basic_17_bad() { int j; for(j = 0; j < 1; j++) { { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108928/CWE605_Multiple_Binds_Same_Port__basic_17.c
CWE605_Multiple_Binds_Same_Port__basic_17_bad
void CWE605_Multiple_Binds_Same_Port__basic_17_bad(void) { int iVar1; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined4 uStack_4c; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined *puStack_30; int iStack_28; undefined4 uStack_24; long lStack_20; int iStack_14; int iStack_10; int iStack_c; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; iStack_14 = 0xffffffff; iStack_10 = -1; lStack_20 = func_0x00400cc0(&uStack_b8); uStack_4c = 1; uStack_24 = 4; iStack_14 = func_0x00400de0(2,1,6); if ((iStack_14 != -1) && (iVar1 = func_0x00400ca0(iStack_14,1,2,&uStack_4c,uStack_24), iVar1 == 0)) { func_0x00400d00(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_14,&uStack_48,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_14,5), iVar1 != -1 && (iStack_10 = func_0x00400db0(iStack_14,0,0), iStack_10 != -1)) && (iStack_28 = func_0x00400c80(iStack_10,(long)&uStack_b8 + lStack_20, (long)(99 - (int)lStack_20),0), iStack_28 != -1)))) && (iStack_28 != 0)) { *(undefined *)((long)&uStack_b8 + (long)iStack_28) = 0; puStack_30 = (undefined *)func_0x00400ce0(&uStack_b8,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400ce0(&uStack_b8,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400d10(iStack_14); } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } printLine(&uStack_b8); } return; }
['gcc']
4,922
void CWE605_Multiple_Binds_Same_Port__basic_17_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108928/CWE605_Multiple_Binds_Same_Port__basic_17.c
CWE605_Multiple_Binds_Same_Port__basic_17_good
void CWE605_Multiple_Binds_Same_Port__basic_17_good(void) { good1(); return; }
['gcc']
4,923
void CWE605_Multiple_Binds_Same_Port__basic_18_bad() { goto sink; sink: { char data[100] = ""; #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; size_t dataLen = strlen(data); #ifdef _WIN32 BOOL bOptVal = TRUE; int bOptLen = sizeof(BOOL); #else int bOptVal = 1; int bOptLen = sizeof(int); #endif do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } /* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */ if (setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&bOptVal, bOptLen) != 0) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, data+dataLen, (int)(100-dataLen-1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[recvResult] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif printLine(data); } }
['/* FLAW: Set the SO_REUSEADDR socket option allowing multiple binds to the same port */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE605']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108929/CWE605_Multiple_Binds_Same_Port__basic_18.c
CWE605_Multiple_Binds_Same_Port__basic_18_bad
void CWE605_Multiple_Binds_Same_Port__basic_18_bad(void) { int iVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined4 uStack_3c; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined *puStack_28; int iStack_20; undefined4 uStack_1c; long lStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; iStack_10 = 0xffffffff; iStack_c = -1; lStack_18 = func_0x00400cc0(&uStack_a8); uStack_3c = 1; uStack_1c = 4; iStack_10 = func_0x00400de0(2,1,6); if ((iStack_10 != -1) && (iVar1 = func_0x00400ca0(iStack_10,1,2,&uStack_3c,uStack_1c), iVar1 == 0) ) { func_0x00400d00(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cd0(0x6987); iVar1 = func_0x00400da0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (((iVar1 = func_0x00400d90(iStack_10,5), iVar1 != -1 && (iStack_c = func_0x00400db0(iStack_10,0,0), iStack_c != -1)) && (iStack_20 = func_0x00400c80(iStack_c,(long)&uStack_a8 + lStack_18, (long)(99 - (int)lStack_18),0), iStack_20 != -1)))) && (iStack_20 != 0)) { *(undefined *)((long)&uStack_a8 + (long)iStack_20) = 0; puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,0xd); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined *)func_0x00400ce0(&uStack_a8,10); if (puStack_28 != (undefined *)0x0) { *puStack_28 = 0; } } } if (iStack_10 != -1) { func_0x00400d10(iStack_10); } if (iStack_c != -1) { func_0x00400d10(iStack_c); } printLine(&uStack_a8); return; }
['gcc']
4,924
void CWE605_Multiple_Binds_Same_Port__basic_18_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108929/CWE605_Multiple_Binds_Same_Port__basic_18.c
CWE605_Multiple_Binds_Same_Port__basic_18_good
void CWE605_Multiple_Binds_Same_Port__basic_18_good(void) { good1(); return; }
['gcc']
4,925
void CWE606_Unchecked_Loop_Condition__char_connect_socket_01_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108930/CWE606_Unchecked_Loop_Condition__char_connect_socket_01.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_01_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_01_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015c4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,926
void CWE606_Unchecked_Loop_Condition__char_connect_socket_01_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108930/CWE606_Unchecked_Loop_Condition__char_connect_socket_01.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_01_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_01_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,927
void CWE606_Unchecked_Loop_Condition__char_connect_socket_02_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(1) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108931/CWE606_Unchecked_Loop_Condition__char_connect_socket_02.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_02_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_02_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015c4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,928
void CWE606_Unchecked_Loop_Condition__char_connect_socket_02_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108931/CWE606_Unchecked_Loop_Condition__char_connect_socket_02.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_02_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_02_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,929
void CWE606_Unchecked_Loop_Condition__char_connect_socket_03_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(5==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(5==5) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108932/CWE606_Unchecked_Loop_Condition__char_connect_socket_03.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_03_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_03_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015c4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,930
void CWE606_Unchecked_Loop_Condition__char_connect_socket_03_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108932/CWE606_Unchecked_Loop_Condition__char_connect_socket_03.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_03_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_03_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,931
void CWE606_Unchecked_Loop_Condition__char_connect_socket_04_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(STATIC_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(STATIC_CONST_TRUE) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108933/CWE606_Unchecked_Loop_Condition__char_connect_socket_04.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_04_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_04_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015dc); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015e6,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,932
void CWE606_Unchecked_Loop_Condition__char_connect_socket_04_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108933/CWE606_Unchecked_Loop_Condition__char_connect_socket_04.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_04_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_04_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,933
void CWE606_Unchecked_Loop_Condition__char_connect_socket_05_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(staticTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(staticTrue) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108934/CWE606_Unchecked_Loop_Condition__char_connect_socket_05.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_05_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_05_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; if (staticTrue != 0) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } if ((staticTrue != 0) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,934
void CWE606_Unchecked_Loop_Condition__char_connect_socket_05_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108934/CWE606_Unchecked_Loop_Condition__char_connect_socket_05.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_05_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_05_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,935
void CWE606_Unchecked_Loop_Condition__char_connect_socket_06_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(STATIC_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(STATIC_CONST_FIVE==5) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108935/CWE606_Unchecked_Loop_Condition__char_connect_socket_06.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_06_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_06_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d8); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015e2,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,936
void CWE606_Unchecked_Loop_Condition__char_connect_socket_06_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108935/CWE606_Unchecked_Loop_Condition__char_connect_socket_06.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_06_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_06_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,937
void CWE606_Unchecked_Loop_Condition__char_connect_socket_07_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(staticFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(staticFive==5) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108936/CWE606_Unchecked_Loop_Condition__char_connect_socket_07.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_07_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_07_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; if (staticFive == 5) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } if ((staticFive == 5) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,938
void CWE606_Unchecked_Loop_Condition__char_connect_socket_07_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108936/CWE606_Unchecked_Loop_Condition__char_connect_socket_07.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_07_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_07_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,939
void CWE606_Unchecked_Loop_Condition__char_connect_socket_08_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(staticReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(staticReturnsTrue()) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108937/CWE606_Unchecked_Loop_Condition__char_connect_socket_08.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_08_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_08_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015f4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } iVar1 = staticReturnsTrue(); if ((iVar1 != 0) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015fe,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,940
void CWE606_Unchecked_Loop_Condition__char_connect_socket_08_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108937/CWE606_Unchecked_Loop_Condition__char_connect_socket_08.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_08_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_08_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,941
void CWE606_Unchecked_Loop_Condition__char_connect_socket_09_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(GLOBAL_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(GLOBAL_CONST_TRUE) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108938/CWE606_Unchecked_Loop_Condition__char_connect_socket_09.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_09_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_09_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; if (GLOBAL_CONST_TRUE != 0) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } if ((GLOBAL_CONST_TRUE != 0) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,942
void CWE606_Unchecked_Loop_Condition__char_connect_socket_09_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108938/CWE606_Unchecked_Loop_Condition__char_connect_socket_09.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_09_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_09_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,943
void CWE606_Unchecked_Loop_Condition__char_connect_socket_10_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(globalTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(globalTrue) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108939/CWE606_Unchecked_Loop_Condition__char_connect_socket_10.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_10_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_10_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; if (globalTrue != 0) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } if ((globalTrue != 0) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,944
void CWE606_Unchecked_Loop_Condition__char_connect_socket_10_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108939/CWE606_Unchecked_Loop_Condition__char_connect_socket_10.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_10_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_10_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,945
void CWE606_Unchecked_Loop_Condition__char_connect_socket_11_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(globalReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(globalReturnsTrue()) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108940/CWE606_Unchecked_Loop_Condition__char_connect_socket_11.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_11_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_11_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015e4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } iVar1 = globalReturnsTrue(); if ((iVar1 != 0) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015ee,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,946
void CWE606_Unchecked_Loop_Condition__char_connect_socket_11_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108940/CWE606_Unchecked_Loop_Condition__char_connect_socket_11.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_11_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_11_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,947
void CWE606_Unchecked_Loop_Condition__char_connect_socket_12_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(globalReturnsTrueOrFalse()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } else { /* FIX: Set data to a number less than MAX_LOOP */ strcpy(data, "15"); } if(globalReturnsTrueOrFalse()) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } else { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* FIX: limit loop iteration counts */ if (n < MAX_LOOP) { intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FIX: Set data to a number less than MAX_LOOP */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */', '/* FIX: limit loop iteration counts */', '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108941/CWE606_Unchecked_Loop_Condition__char_connect_socket_12.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_12_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_12_bad(void) { undefined8 *puVar1; int iVar2; int iStack_c0; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_40; int iStack_34; long lStack_30; int iStack_24; undefined8 *puStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_20 = &uStack_a8; iVar2 = globalReturnsTrueOrFalse(); puVar1 = puStack_20; if (iVar2 == 0) { *(undefined2 *)puStack_20 = 0x3531; *(undefined *)((long)puVar1 + 2) = 0; } else { iStack_24 = 0xffffffff; lStack_30 = func_0x00400c30(puStack_20); iStack_24 = func_0x00400d40(2,1,6); if (iStack_24 != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_00401654); uStack_b6 = func_0x00400c40(0x6987); iVar2 = func_0x00400d10(iStack_24,&uStack_b8,0x10); if (((iVar2 != -1) && (iStack_34 = func_0x00400c00(iStack_24,(long)puStack_20 + lStack_30,99 - lStack_30,0), iStack_34 != -1)) && (iStack_34 != 0)) { *(undefined *)((long)puStack_20 + iStack_34 + lStack_30) = 0; puStack_40 = (undefined *)func_0x00400c50(puStack_20,0xd); if (puStack_40 != (undefined *)0x0) { *puStack_40 = 0; } puStack_40 = (undefined *)func_0x00400c50(puStack_20,10); if (puStack_40 != (undefined *)0x0) { *puStack_40 = 0; } } } if (iStack_24 != -1) { func_0x00400c80(iStack_24); } } iVar2 = globalReturnsTrueOrFalse(); if (iVar2 == 0) { iVar2 = func_0x00400d00(puStack_20,&UNK_0040165e,&iStack_c0); if ((iVar2 == 1) && (iStack_c0 < 10000)) { iStack_18 = 0; for (iStack_14 = 0; iStack_14 < iStack_c0; iStack_14 = iStack_14 + 1) { iStack_18 = iStack_18 + 1; } printIntLine(iStack_18); } } else { iVar2 = func_0x00400d00(puStack_20,&UNK_0040165e,&iStack_bc); if (iVar2 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } return; }
['gcc']
4,948
void CWE606_Unchecked_Loop_Condition__char_connect_socket_12_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108941/CWE606_Unchecked_Loop_Condition__char_connect_socket_12.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_12_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_12_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
4,949
void CWE606_Unchecked_Loop_Condition__char_connect_socket_13_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(GLOBAL_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(GLOBAL_CONST_FIVE==5) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108942/CWE606_Unchecked_Loop_Condition__char_connect_socket_13.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_13_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_13_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; if (GLOBAL_CONST_FIVE == 5) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } if ((GLOBAL_CONST_FIVE == 5) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,950
void CWE606_Unchecked_Loop_Condition__char_connect_socket_13_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108942/CWE606_Unchecked_Loop_Condition__char_connect_socket_13.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_13_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_13_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,951
void CWE606_Unchecked_Loop_Condition__char_connect_socket_14_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; if(globalFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(globalFive==5) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108943/CWE606_Unchecked_Loop_Condition__char_connect_socket_14.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_14_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_14_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; if (globalFive == 5) { iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015d4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } } if ((globalFive == 5) && (iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_bc), iVar1 == 1)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,952
void CWE606_Unchecked_Loop_Condition__char_connect_socket_14_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108943/CWE606_Unchecked_Loop_Condition__char_connect_socket_14.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_14_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_14_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,953
void CWE606_Unchecked_Loop_Condition__char_connect_socket_15_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; switch(6) { case 6: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } switch(7) { case 7: { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108944/CWE606_Unchecked_Loop_Condition__char_connect_socket_15.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_15_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_15_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015c4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,954
void CWE606_Unchecked_Loop_Condition__char_connect_socket_15_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108944/CWE606_Unchecked_Loop_Condition__char_connect_socket_15.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_15_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_15_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
4,955
void CWE606_Unchecked_Loop_Condition__char_connect_socket_16_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; while(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; } while(1) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } break; } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108945/CWE606_Unchecked_Loop_Condition__char_connect_socket_16.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_16_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_16_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015c4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,956
void CWE606_Unchecked_Loop_Condition__char_connect_socket_16_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108945/CWE606_Unchecked_Loop_Condition__char_connect_socket_16.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_16_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_16_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
4,957
void CWE606_Unchecked_Loop_Condition__char_connect_socket_17_bad() { int i,j; char * data; char dataBuffer[100] = ""; data = dataBuffer; for(i = 0; i < 1; i++) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } for(j = 0; j < 1; j++) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108946/CWE606_Unchecked_Loop_Condition__char_connect_socket_17.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_17_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_17_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_40; int iStack_34; long lStack_30; int iStack_24; undefined8 *puStack_20; int iStack_18; int iStack_14; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_20 = &uStack_a8; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { iStack_24 = 0xffffffff; lStack_30 = func_0x00400c30(puStack_20); iStack_24 = func_0x00400d40(2,1,6); if (iStack_24 != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015f4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_24,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_34 = func_0x00400c00(iStack_24,(long)puStack_20 + lStack_30,99 - lStack_30,0), iStack_34 != -1)) && (iStack_34 != 0)) { *(undefined *)((long)puStack_20 + iStack_34 + lStack_30) = 0; puStack_40 = (undefined *)func_0x00400c50(puStack_20,0xd); if (puStack_40 != (undefined *)0x0) { *puStack_40 = 0; } puStack_40 = (undefined *)func_0x00400c50(puStack_20,10); if (puStack_40 != (undefined *)0x0) { *puStack_40 = 0; } } } if (iStack_24 != -1) { func_0x00400c80(iStack_24); } } for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) { iVar1 = func_0x00400d00(puStack_20,&UNK_004015fe,&iStack_bc); if (iVar1 == 1) { iStack_18 = 0; for (iStack_14 = 0; iStack_14 < iStack_bc; iStack_14 = iStack_14 + 1) { iStack_18 = iStack_18 + 1; } printIntLine(iStack_18); } } return; }
['gcc']
4,958
void CWE606_Unchecked_Loop_Condition__char_connect_socket_17_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108946/CWE606_Unchecked_Loop_Condition__char_connect_socket_17.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_17_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_17_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
4,959
void CWE606_Unchecked_Loop_Condition__char_connect_socket_18_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; goto source; source: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } goto sink; sink: { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108947/CWE606_Unchecked_Loop_Condition__char_connect_socket_18.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_18_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_18_bad(void) { int iVar1; int iStack_bc; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015c4); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,960
void CWE606_Unchecked_Loop_Condition__char_connect_socket_18_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108947/CWE606_Unchecked_Loop_Condition__char_connect_socket_18.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_18_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_18_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
4,961
void CWE606_Unchecked_Loop_Condition__char_connect_socket_21_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } badStatic = 1; /* true */ badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* true */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108948/CWE606_Unchecked_Loop_Condition__char_connect_socket_21.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_21_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_21_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_004015e7); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } badStatic = 1; badSink(puStack_10); return; }
['gcc']
4,962
void CWE606_Unchecked_Loop_Condition__char_connect_socket_21_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108948/CWE606_Unchecked_Loop_Condition__char_connect_socket_21.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_21_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_21_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']
4,963
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badGlobal = 1; /* true */ CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* true */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108949/CWE606_Unchecked_Loop_Condition__char_connect_socket_22a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_22_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_004015e4); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badGlobal = 1; CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badSink(puStack_10); return; }
['gcc']
4,964
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108949/CWE606_Unchecked_Loop_Condition__char_connect_socket_22a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_22_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']
4,965
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badSink(char * data) { if(CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badGlobal) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108949/CWE606_Unchecked_Loop_Condition__char_connect_socket_22b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; if (CWE606_Unchecked_Loop_Condition__char_connect_socket_22_badGlobal != 0) { iVar1 = func_0x00400d00(param_1,&UNK_004015e4,&iStack_14); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } return; }
['gcc']
4,966
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G1Sink(char * data) { if(CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* FIX: limit loop iteration counts */ if (n < MAX_LOOP) { intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } } }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: limit loop iteration counts */', '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108949/CWE606_Unchecked_Loop_Condition__char_connect_socket_22b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G1Sink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G1Sink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; if (CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G1Global == 0) { iVar1 = func_0x00400d00(param_1,&UNK_00401989,&iStack_14); if ((iVar1 == 1) && (iStack_14 < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } else { printLine(&UNK_00401974); } return; }
['gcc']
4,967
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G2Sink(char * data) { if(CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G2Global) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* FIX: limit loop iteration counts */ if (n < MAX_LOOP) { intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } } }
['/* FIX: limit loop iteration counts */', '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108949/CWE606_Unchecked_Loop_Condition__char_connect_socket_22b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G2Sink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G2Sink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; if (CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodB2G2Global != 0) { iVar1 = func_0x00400d00(param_1,&UNK_00401989,&iStack_14); if ((iVar1 == 1) && (iStack_14 < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } return; }
['gcc']
4,968
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodG2BSink(char * data) { if(CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodG2BGlobal) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108949/CWE606_Unchecked_Loop_Condition__char_connect_socket_22b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodG2BSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; if (CWE606_Unchecked_Loop_Condition__char_connect_socket_22_goodG2BGlobal != 0) { iVar1 = func_0x00400d00(param_1,&UNK_00401989,&iStack_14); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } return; }
['gcc']
4,969
void CWE606_Unchecked_Loop_Condition__char_connect_socket_31_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { char * dataCopy = data; char * data = dataCopy; { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108950/CWE606_Unchecked_Loop_Condition__char_connect_socket_31.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_31_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_31_bad(void) { int iVar1; int iStack_cc; undefined2 uStack_c8; undefined2 uStack_c6; undefined4 uStack_c4; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined8 *puStack_48; undefined8 *puStack_40; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; puStack_18 = &uStack_b8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_c8,0,0x10); uStack_c8 = 2; uStack_c4 = func_0x00400cc0(&UNK_004015d4); uStack_c6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_c8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } puStack_40 = puStack_18; puStack_48 = puStack_18; iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_cc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_cc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,970
void CWE606_Unchecked_Loop_Condition__char_connect_socket_31_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108950/CWE606_Unchecked_Loop_Condition__char_connect_socket_31.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_31_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_31_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,971
void CWE606_Unchecked_Loop_Condition__char_connect_socket_32_bad() { char * data; char * *dataPtr1 = &data; char * *dataPtr2 = &data; char dataBuffer[100] = ""; data = dataBuffer; { char * data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { char * data = *dataPtr2; { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108951/CWE606_Unchecked_Loop_Condition__char_connect_socket_32.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE606_Unchecked_Loop_Condition__char_connect_socket_32_bad(void) { int iVar1; int iStack_dc; undefined2 uStack_d8; undefined2 uStack_d6; undefined4 uStack_d4; undefined8 uStack_c8; undefined8 uStack_c0; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined4 uStack_68; undefined8 *puStack_58; undefined8 *puStack_50; undefined *puStack_48; int iStack_3c; long lStack_38; int iStack_2c; undefined8 *puStack_28; undefined8 **ppuStack_20; undefined8 **ppuStack_18; int iStack_10; int iStack_c; ppuStack_18 = &puStack_58; ppuStack_20 = &puStack_58; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; puStack_58 = &uStack_c8; iStack_2c = 0xffffffff; puStack_28 = puStack_58; lStack_38 = func_0x00400c30(puStack_58); iStack_2c = func_0x00400d40(2,1,6); if (iStack_2c != -1) { func_0x00400c70(&uStack_d8,0,0x10); uStack_d8 = 2; uStack_d4 = func_0x00400cc0(&UNK_00401604); uStack_d6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_2c,&uStack_d8,0x10); if (((iVar1 != -1) && (iStack_3c = func_0x00400c00(iStack_2c,(long)puStack_28 + lStack_38,99 - lStack_38,0), iStack_3c != -1)) && (iStack_3c != 0)) { *(undefined *)((long)puStack_28 + iStack_3c + lStack_38) = 0; puStack_48 = (undefined *)func_0x00400c50(puStack_28,0xd); if (puStack_48 != (undefined *)0x0) { *puStack_48 = 0; } puStack_48 = (undefined *)func_0x00400c50(puStack_28,10); if (puStack_48 != (undefined *)0x0) { *puStack_48 = 0; } } } if (iStack_2c != -1) { func_0x00400c80(iStack_2c); } *ppuStack_18 = puStack_28; puStack_50 = *ppuStack_20; iVar1 = func_0x00400d00(puStack_50,&UNK_0040160e,&iStack_dc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_dc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,972
void CWE606_Unchecked_Loop_Condition__char_connect_socket_32_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108951/CWE606_Unchecked_Loop_Condition__char_connect_socket_32.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_32_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_32_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,973
void CWE606_Unchecked_Loop_Condition__char_connect_socket_34_bad() { char * data; CWE606_Unchecked_Loop_Condition__char_connect_socket_34_unionType myUnion; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { char * data = myUnion.unionSecond; { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', "/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108953/CWE606_Unchecked_Loop_Condition__char_connect_socket_34.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_34_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_34_bad(void) { int iVar1; int iStack_cc; undefined2 uStack_c8; undefined2 uStack_c6; undefined4 uStack_c4; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined8 *puStack_48; undefined8 *puStack_40; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; puStack_18 = &uStack_b8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_c8,0,0x10); uStack_c8 = 2; uStack_c4 = func_0x00400cc0(&UNK_004015d4); uStack_c6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_c8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } puStack_48 = puStack_18; puStack_40 = puStack_18; iVar1 = func_0x00400d00(puStack_18,&UNK_004015de,&iStack_cc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_cc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,974
void CWE606_Unchecked_Loop_Condition__char_connect_socket_34_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108953/CWE606_Unchecked_Loop_Condition__char_connect_socket_34.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_34_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_34_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,975
void CWE606_Unchecked_Loop_Condition__char_connect_socket_41_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108954/CWE606_Unchecked_Loop_Condition__char_connect_socket_41.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_41_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_41_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_004015d7); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } badSink(puStack_10); return; }
['gcc']
4,976
void CWE606_Unchecked_Loop_Condition__char_connect_socket_41_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108954/CWE606_Unchecked_Loop_Condition__char_connect_socket_41.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_41_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_41_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
4,977
void CWE606_Unchecked_Loop_Condition__char_connect_socket_42_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; data = badSource(data); { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108955/CWE606_Unchecked_Loop_Condition__char_connect_socket_42.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_42_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_42_bad(void) { int iVar1; int iStack_8c; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_18 = &uStack_88; puStack_18 = (undefined8 *)badSource(puStack_18); iVar1 = func_0x00400d00(puStack_18,&UNK_004015ce,&iStack_8c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_8c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,978
void CWE606_Unchecked_Loop_Condition__char_connect_socket_42_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108955/CWE606_Unchecked_Loop_Condition__char_connect_socket_42.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_42_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_42_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
4,979
void CWE606_Unchecked_Loop_Condition__char_connect_socket_44_bad() { char * data; /* define a function pointer */ void (*funcPtr) (char *) = badSink; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* use the function pointer */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108957/CWE606_Unchecked_Loop_Condition__char_connect_socket_44.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_44_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_44_bad(void) { int iVar1; undefined2 uStack_b8; undefined2 uStack_b6; undefined4 uStack_b4; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; code *pcStack_10; pcStack_10 = badSink; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_18 = &uStack_a8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c30(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_b8,0,0x10); uStack_b8 = 2; uStack_b4 = func_0x00400cc0(&UNK_004015e7); uStack_b6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_b8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,(long)puStack_18 + lStack_28,99 - lStack_28,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined *)((long)puStack_18 + iStack_2c + lStack_28) = 0; puStack_38 = (undefined *)func_0x00400c50(puStack_18,0xd); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined *)func_0x00400c50(puStack_18,10); if (puStack_38 != (undefined *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } (*pcStack_10)(puStack_18); return; }
['gcc']
4,980
void CWE606_Unchecked_Loop_Condition__char_connect_socket_44_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108957/CWE606_Unchecked_Loop_Condition__char_connect_socket_44.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_44_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_44_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,981
void CWE606_Unchecked_Loop_Condition__char_connect_socket_45_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__char_connect_socket_45_badData = data; badSink(); }
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108958/CWE606_Unchecked_Loop_Condition__char_connect_socket_45.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_45_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_45_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_004015e7); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } CWE606_Unchecked_Loop_Condition__char_connect_socket_45_badData = puStack_10; badSink(); return; }
['gcc']
4,982
void CWE606_Unchecked_Loop_Condition__char_connect_socket_45_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108958/CWE606_Unchecked_Loop_Condition__char_connect_socket_45.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_45_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_45_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,983
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108959/CWE606_Unchecked_Loop_Condition__char_connect_socket_51a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_51_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_004015d4); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_badSink(puStack_10); return; }
['gcc']
4,984
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108959/CWE606_Unchecked_Loop_Condition__char_connect_socket_51a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_51_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,985
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_badSink(char * data) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108959/CWE606_Unchecked_Loop_Condition__char_connect_socket_51b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_badSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400d00(param_1,&UNK_004015d4,&iStack_14); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,986
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_goodG2BSink(char * data) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108959/CWE606_Unchecked_Loop_Condition__char_connect_socket_51b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400d00(param_1,&UNK_004016e4,&iStack_14); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,987
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_goodB2GSink(char * data) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* FIX: limit loop iteration counts */ if (n < MAX_LOOP) { intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* FIX: limit loop iteration counts */', '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108959/CWE606_Unchecked_Loop_Condition__char_connect_socket_51b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_51b_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400d00(param_1,&UNK_004016e4,&iStack_14); if ((iVar1 == 1) && (iStack_14 < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,988
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_004015e4); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_badSink(puStack_10); return; }
['gcc']
4,989
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,990
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_badSink(char * data) { CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_badSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_badSink(param_1); return; }
['gcc']
4,991
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_goodG2BSink(char * data) { CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodG2BSink(param_1); return; }
['gcc']
4,992
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_goodB2GSink(char * data) { CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52b_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodB2GSink(param_1); return; }
['gcc']
4,993
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_badSink(char * data) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52c.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_badSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400d00(param_1,&UNK_004015e4,&iStack_14); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,994
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodG2BSink(char * data) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */ intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } }
["/* POTENTIAL FLAW: user-supplied value 'n' could lead to very large loop iteration */", '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52c.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodG2BSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400d00(param_1,&UNK_00401714,&iStack_14); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,995
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodB2GSink(char * data) { { int i, n, intVariable; if (sscanf(data, "%d", &n) == 1) { /* FIX: limit loop iteration counts */ if (n < MAX_LOOP) { intVariable = 0; for (i = 0; i < n; i++) { /* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */ intVariable++; /* avoid a dead/empty code block issue */ } printIntLine(intVariable); } } } }
['/* FIX: limit loop iteration counts */', '/* INCIDENTAL: CWE 561: Dead Code - non-avoidable if n <= 0 */', '/* avoid a dead/empty code block issue */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108960/CWE606_Unchecked_Loop_Condition__char_connect_socket_52c.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodB2GSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_52c_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400d00(param_1,&UNK_00401714,&iStack_14); if ((iVar1 == 1) && (iStack_14 < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_14; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
4,996
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53_bad() { char * data; char dataBuffer[100] = ""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; char *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = strlen(data); 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 */ /* Abort on error or the connection was closed */ recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(char) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(char)] = '\0'; /* Eliminate CRLF */ replace = strchr(data, '\r'); if (replace) { *replace = '\0'; } replace = strchr(data, '\n'); if (replace) { *replace = '\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108961/CWE606_Unchecked_Loop_Condition__char_connect_socket_53a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_53_bad
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53_bad(void) { int iVar1; undefined2 uStack_a8; undefined2 uStack_a6; undefined4 uStack_a4; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c30(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c70(&uStack_a8,0,0x10); uStack_a8 = 2; uStack_a4 = func_0x00400cc0(&UNK_00401604); uStack_a6 = func_0x00400c40(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_a8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,(long)puStack_10 + lStack_20,99 - lStack_20,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined *)((long)puStack_10 + iStack_24 + lStack_20) = 0; puStack_30 = (undefined *)func_0x00400c50(puStack_10,0xd); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined *)func_0x00400c50(puStack_10,10); if (puStack_30 != (undefined *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c80(iStack_14); } CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_badSink(puStack_10); return; }
['gcc']
4,997
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108961/CWE606_Unchecked_Loop_Condition__char_connect_socket_53a.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_53_good
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
4,998
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_badSink(char * data) { CWE606_Unchecked_Loop_Condition__char_connect_socket_53c_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108961/CWE606_Unchecked_Loop_Condition__char_connect_socket_53b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_badSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__char_connect_socket_53c_badSink(param_1); return; }
['gcc']
4,999
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_goodG2BSink(char * data) { CWE606_Unchecked_Loop_Condition__char_connect_socket_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/108961/CWE606_Unchecked_Loop_Condition__char_connect_socket_53b.c
CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__char_connect_socket_53b_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__char_connect_socket_53c_goodG2BSink(param_1); return; }
['gcc']