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
5,600
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_22_goodG2BSink(wchar_t * data) { if(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_22_goodG2BGlobal) { { int i, n, intVariable; if (swscanf(data, L"%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/109189/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_22b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_22_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_22_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; if (CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_22_goodG2BGlobal != 0) { iVar1 = func_0x00400ce0(param_1,&UNK_0040197c,&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']
5,601
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { wchar_t * dataCopy = data; wchar_t * data = dataCopy; { int i, n, intVariable; if (swscanf(data, L"%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/109190/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1ec; undefined2 uStack_1e8; undefined2 uStack_1e6; undefined4 uStack_1e4; undefined8 uStack_1d8; undefined8 uStack_1d0; undefined8 auStack_1c8 [48]; undefined8 *puStack_48; undefined8 *puStack_40; undefined4 *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1d8 = 0; uStack_1d0 = 0; puVar3 = auStack_1c8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1d8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c50(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c60(&uStack_1e8,0,0x10); uStack_1e8 = 2; uStack_1e4 = func_0x00400cb0(&UNK_004015b4); uStack_1e6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_1e8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4 ,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0; puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,0xd); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,10); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c70(iStack_1c); } puStack_40 = puStack_18; puStack_48 = puStack_18; iVar1 = func_0x00400ca0(puStack_18,&UNK_004015c0,&iStack_1ec); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1ec; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,602
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109190/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_31_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,603
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32_bad() { wchar_t * data; wchar_t * *dataPtr1 = &data; wchar_t * *dataPtr2 = &data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { wchar_t * data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { wchar_t * data = *dataPtr2; { int i, n, intVariable; if (swscanf(data, L"%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/109191/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1fc; undefined2 uStack_1f8; undefined2 uStack_1f6; undefined4 uStack_1f4; undefined8 uStack_1e8; undefined8 uStack_1e0; undefined8 auStack_1d8 [48]; undefined8 *puStack_58; undefined8 *puStack_50; undefined4 *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_1e8 = 0; uStack_1e0 = 0; puVar3 = auStack_1d8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_58 = &uStack_1e8; puStack_28 = *ppuStack_18; iStack_2c = 0xffffffff; lStack_38 = func_0x00400c50(puStack_28); iStack_2c = func_0x00400d40(2,1,6); if (iStack_2c != -1) { func_0x00400c60(&uStack_1f8,0,0x10); uStack_1f8 = 2; uStack_1f4 = func_0x00400cb0(&UNK_004015d4); uStack_1f6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_2c,&uStack_1f8,0x10); if (((iVar1 != -1) && (iStack_3c = func_0x00400c00(iStack_2c,lStack_38 * 4 + (long)puStack_28,(99 - lStack_38) * 4 ,0), iStack_3c != -1)) && (iStack_3c != 0)) { *(undefined4 *)((long)puStack_28 + (lStack_38 + ((ulong)(long)iStack_3c >> 2)) * 4) = 0; puStack_48 = (undefined4 *)func_0x00400d00(puStack_28,0xd); if (puStack_48 != (undefined4 *)0x0) { *puStack_48 = 0; } puStack_48 = (undefined4 *)func_0x00400d00(puStack_28,10); if (puStack_48 != (undefined4 *)0x0) { *puStack_48 = 0; } } } if (iStack_2c != -1) { func_0x00400c70(iStack_2c); } *ppuStack_18 = puStack_28; puStack_50 = *ppuStack_20; iVar1 = func_0x00400ca0(puStack_50,&UNK_004015e0,&iStack_1fc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1fc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,604
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109191/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_32_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,605
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_bad() { wchar_t * data; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_unionType myUnion; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { wchar_t * data = myUnion.unionSecond; { int i, n, intVariable; if (swscanf(data, L"%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/109193/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1ec; undefined2 uStack_1e8; undefined2 uStack_1e6; undefined4 uStack_1e4; undefined8 uStack_1d8; undefined8 uStack_1d0; undefined8 auStack_1c8 [48]; undefined8 *puStack_48; undefined8 *puStack_40; undefined4 *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1d8 = 0; uStack_1d0 = 0; puVar3 = auStack_1c8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1d8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c50(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c60(&uStack_1e8,0,0x10); uStack_1e8 = 2; uStack_1e4 = func_0x00400cb0(&UNK_004015b4); uStack_1e6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_1e8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4 ,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0; puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,0xd); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,10); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c70(iStack_1c); } puStack_48 = puStack_18; puStack_40 = puStack_18; iVar1 = func_0x00400ca0(puStack_18,&UNK_004015c0,&iStack_1ec); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1ec; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,606
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109193/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_34_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,607
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\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/109194/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015c0); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } badSink(puStack_10); return; }
['gcc']
5,608
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109194/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_41_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
5,609
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; data = badSource(data); { int i, n, intVariable; if (swscanf(data, L"%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/109195/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1ac; undefined8 uStack_1a8; undefined8 uStack_1a0; undefined8 auStack_198 [48]; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1a8 = 0; uStack_1a0 = 0; puVar3 = auStack_198; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1a8; puStack_18 = (undefined8 *)badSource(puStack_18); iVar1 = func_0x00400ca0(puStack_18,&UNK_004015c0,&iStack_1ac); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1ac; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,610
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109195/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_42_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
5,611
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44_bad() { wchar_t * data; /* define a function pointer */ void (*funcPtr) (wchar_t *) = badSink; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\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/109197/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [48]; undefined4 *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; code *pcStack_10; pcStack_10 = badSink; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1c8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c50(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015d0); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4 ,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0; puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,0xd); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,10); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c70(iStack_1c); } (*pcStack_10)(puStack_18); return; }
['gcc']
5,612
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109197/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_44_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,613
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_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/109198/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015d0); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_badData = puStack_10; badSink(); return; }
['gcc']
5,614
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109198/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_45_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,615
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_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/109199/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015b4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_badSink(puStack_10); return; }
['gcc']
5,616
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109199/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,617
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_badSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109199/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ca0(param_1,&UNK_004015b4,&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']
5,618
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_goodG2BSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109199/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(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']
5,619
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_goodB2GSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109199/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_51b_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(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']
5,620
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_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/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015d4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_badSink(puStack_10); return; }
['gcc']
5,621
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,622
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_badSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_badSink(param_1); return; }
['gcc']
5,623
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_goodG2BSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodG2BSink(param_1); return; }
['gcc']
5,624
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_goodB2GSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52b_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodB2GSink(param_1); return; }
['gcc']
5,625
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_badSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ca0(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']
5,626
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodG2BSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_00401724,&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']
5,627
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodB2GSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109200/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_52c_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_00401724,&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']
5,628
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_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/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015f4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_badSink(puStack_10); return; }
['gcc']
5,629
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,630
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_badSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_badSink(param_1); return; }
['gcc']
5,631
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_goodG2BSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodG2BSink(param_1); return; }
['gcc']
5,632
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_goodB2GSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53b_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodB2GSink(param_1); return; }
['gcc']
5,633
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_badSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_badSink(param_1); return; }
['gcc']
5,634
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodG2BSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodG2BSink(param_1); return; }
['gcc']
5,635
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodB2GSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53c_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodB2GSink(param_1); return; }
['gcc']
5,636
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_badSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ca0(param_1,&UNK_004015f4,&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']
5,637
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodG2BSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_00401754,&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']
5,638
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodB2GSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109201/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_53d_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_00401754,&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']
5,639
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_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/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_00401604); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_badSink(puStack_10); return; }
['gcc']
5,640
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,641
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_badSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_badSink(param_1); return; }
['gcc']
5,642
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_goodG2BSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodG2BSink(param_1); return; }
['gcc']
5,643
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_goodB2GSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54b_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodB2GSink(param_1); return; }
['gcc']
5,644
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_badSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_badSink(param_1); return; }
['gcc']
5,645
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodG2BSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodG2BSink(param_1); return; }
['gcc']
5,646
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodB2GSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54c_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodB2GSink(param_1); return; }
['gcc']
5,647
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_badSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_badSink(data); }
[]
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_badSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_badSink(param_1); return; }
['gcc']
5,648
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodG2BSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodG2BSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodG2BSink(param_1); return; }
['gcc']
5,649
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodB2GSink(wchar_t * data) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54d_goodB2GSink(undefined8 param_1) { CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodB2GSink(param_1); return; }
['gcc']
5,650
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_badSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ca0(param_1,&UNK_00401604,&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']
5,651
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodG2BSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_00401784,&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']
5,652
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodB2GSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109202/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_54e_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_00401784,&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']
5,653
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; data = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_badSource(data); { int i, n, intVariable; if (swscanf(data, L"%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/109203/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1ac; undefined8 uStack_1a8; undefined8 uStack_1a0; undefined8 auStack_198 [48]; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1a8 = 0; uStack_1a0 = 0; puVar3 = auStack_198; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1a8; puStack_18 = (undefined8 *) CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_badSource(puStack_18); iVar1 = func_0x00400ca0(puStack_18,&UNK_004015b4,&iStack_1ac); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1ac; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,654
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109203/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,655
wchar_t * CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_badSource(wchar_t * data) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/109203/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_badSource
long CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_badSource(long param_1) { int iVar1; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined4 *puStack_28; int iStack_1c; long lStack_18; int iStack_c; iStack_c = 0xffffffff; lStack_18 = func_0x00400c50(param_1); iStack_c = func_0x00400d40(2,1,6); if (iStack_c != -1) { func_0x00400c60(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cb0(&UNK_004015b4); uStack_36 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_1c = func_0x00400c00(iStack_c,lStack_18 * 4 + param_1,(99 - lStack_18) * 4,0), iStack_1c != -1)) && (iStack_1c != 0)) { *(undefined4 *)(param_1 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0; puStack_28 = (undefined4 *)func_0x00400d00(param_1,0xd); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined4 *)func_0x00400d00(param_1,10); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } } } if (iStack_c != -1) { func_0x00400c70(iStack_c); } return param_1; }
['gcc']
5,656
wchar_t * CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_goodG2BSource(wchar_t * data) { /* FIX: Set data to a number less than MAX_LOOP */ wcscpy(data, L"15"); return data; }
['/* FIX: Set data to a number less than MAX_LOOP */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109203/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_goodG2BSource
undefined8 CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_goodG2BSource(undefined8 param_1) { func_0x00400d00(param_1,&UNK_004016f4); return param_1; }
['gcc']
5,657
wchar_t * CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_goodB2GSource(wchar_t * data) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } return data; }
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109203/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_goodB2GSource
long CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_61b_goodB2GSource(long param_1) { int iVar1; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined4 *puStack_28; int iStack_1c; long lStack_18; int iStack_c; iStack_c = 0xffffffff; lStack_18 = func_0x00400c90(param_1); iStack_c = func_0x00400d90(2,1,6); if (iStack_c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cf0(&UNK_00401700); uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d60(iStack_c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_1c = func_0x00400c40(iStack_c,lStack_18 * 4 + param_1,(99 - lStack_18) * 4,0), iStack_1c != -1)) && (iStack_1c != 0)) { *(undefined4 *)(param_1 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0; puStack_28 = (undefined4 *)func_0x00400d50(param_1,0xd); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined4 *)func_0x00400d50(param_1,10); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } } } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } return param_1; }
['gcc']
5,658
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_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/109205/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined8 *puStack_30; undefined4 *puStack_28; int iStack_1c; long lStack_18; int iStack_c; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_30 = &uStack_1c8; iStack_c = 0xffffffff; lStack_18 = func_0x00400c50(puStack_30); iStack_c = func_0x00400d40(2,1,6); if (iStack_c != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015b4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_c,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_1c = func_0x00400c00(iStack_c,(long)puStack_30 + lStack_18 * 4,(99 - lStack_18) * 4, 0), iStack_1c != -1)) && (iStack_1c != 0)) { *(undefined4 *)((long)puStack_30 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0; puStack_28 = (undefined4 *)func_0x00400d00(puStack_30,0xd); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined4 *)func_0x00400d00(puStack_30,10); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } } } if (iStack_c != -1) { func_0x00400c70(iStack_c); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_badSink(&puStack_30); return; }
['gcc']
5,659
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109205/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,660
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_badSink(wchar_t * * dataPtr) { wchar_t * data = *dataPtr; { int i, n, intVariable; if (swscanf(data, L"%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/109205/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_badSink(undefined8 *param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = *param_1; iVar1 = func_0x00400ca0(uStack_18,&UNK_004015b4,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,661
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_goodG2BSink(wchar_t * * dataPtr) { wchar_t * data = *dataPtr; { int i, n, intVariable; if (swscanf(data, L"%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/109205/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_goodG2BSink(undefined8 *param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = *param_1; iVar1 = func_0x00400ce0(uStack_18,&UNK_004016f4,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,662
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_goodB2GSink(wchar_t * * dataPtr) { wchar_t * data = *dataPtr; { int i, n, intVariable; if (swscanf(data, L"%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/109205/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_63b_goodB2GSink(undefined8 *param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = *param_1; iVar1 = func_0x00400ce0(uStack_18,&UNK_004016f4,&iStack_1c); if ((iVar1 == 1) && (iStack_1c < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,663
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_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/109206/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined8 *puStack_30; undefined4 *puStack_28; int iStack_1c; long lStack_18; int iStack_c; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_30 = &uStack_1c8; iStack_c = 0xffffffff; lStack_18 = func_0x00400c50(puStack_30); iStack_c = func_0x00400d40(2,1,6); if (iStack_c != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015c4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_c,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_1c = func_0x00400c00(iStack_c,(long)puStack_30 + lStack_18 * 4,(99 - lStack_18) * 4, 0), iStack_1c != -1)) && (iStack_1c != 0)) { *(undefined4 *)((long)puStack_30 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0; puStack_28 = (undefined4 *)func_0x00400d00(puStack_30,0xd); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } puStack_28 = (undefined4 *)func_0x00400d00(puStack_30,10); if (puStack_28 != (undefined4 *)0x0) { *puStack_28 = 0; } } } if (iStack_c != -1) { func_0x00400c70(iStack_c); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_badSink(&puStack_30); return; }
['gcc']
5,664
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109206/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,665
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr; /* dereference dataPtr into data */ wchar_t * data = (*dataPtr); { int i, n, intVariable; if (swscanf(data, L"%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); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', "/* 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/109206/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_badSink(undefined8 *param_1) { int iVar1; int iStack_24; undefined8 uStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_20 = *param_1; puStack_18 = param_1; iVar1 = func_0x00400ca0(uStack_20,&UNK_004015c4,&iStack_24); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_24; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,666
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr; /* dereference dataPtr into data */ wchar_t * data = (*dataPtr); { int i, n, intVariable; if (swscanf(data, L"%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); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', "/* 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/109206/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_goodG2BSink(undefined8 *param_1) { int iVar1; int iStack_24; undefined8 uStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_20 = *param_1; puStack_18 = param_1; iVar1 = func_0x00400ce0(uStack_20,&UNK_00401704,&iStack_24); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_24; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,667
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_goodB2GSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr; /* dereference dataPtr into data */ wchar_t * data = (*dataPtr); { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* 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/109206/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_64b_goodB2GSink(undefined8 *param_1) { int iVar1; int iStack_24; undefined8 uStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_20 = *param_1; puStack_18 = param_1; iVar1 = func_0x00400ce0(uStack_20,&UNK_00401704,&iStack_24); if ((iVar1 == 1) && (iStack_24 < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_24; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,668
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65_bad() { wchar_t * data; /* define a function pointer */ void (*funcPtr) (wchar_t *) = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_badSink; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\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/109207/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [48]; undefined4 *puStack_38; int iStack_2c; long lStack_28; int iStack_1c; undefined8 *puStack_18; code *pcStack_10; pcStack_10 = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_badSink; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1c8; iStack_1c = 0xffffffff; lStack_28 = func_0x00400c50(puStack_18); iStack_1c = func_0x00400d40(2,1,6); if (iStack_1c != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015c4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_1c,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_2c = func_0x00400c00(iStack_1c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4 ,0), iStack_2c != -1)) && (iStack_2c != 0)) { *(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0; puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,0xd); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } puStack_38 = (undefined4 *)func_0x00400d00(puStack_18,10); if (puStack_38 != (undefined4 *)0x0) { *puStack_38 = 0; } } } if (iStack_1c != -1) { func_0x00400c70(iStack_1c); } (*pcStack_10)(puStack_18); return; }
['gcc']
5,669
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109207/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,670
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_badSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109207/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_badSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ca0(param_1,&UNK_004015c4,&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']
5,671
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_goodG2BSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109207/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_004016f4,&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']
5,672
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_goodB2GSink(wchar_t * data) { { int i, n, intVariable; if (swscanf(data, L"%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/109207/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_65b_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_14; int iStack_10; int iStack_c; iVar1 = func_0x00400ce0(param_1,&UNK_004016f4,&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']
5,673
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66_bad() { wchar_t * data; wchar_t * dataArray[5]; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* put data in array */ dataArray[2] = data; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_badSink(dataArray); }
['/* 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 */', '/* put data in array */']
['CWE606']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109208/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1f8; undefined2 uStack_1f6; undefined4 uStack_1f4; undefined8 uStack_1e8; undefined8 uStack_1e0; undefined8 auStack_1d8 [48]; undefined auStack_58 [16]; undefined8 *puStack_48; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1e8 = 0; uStack_1e0 = 0; puVar3 = auStack_1d8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1e8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1f8,0,0x10); uStack_1f8 = 2; uStack_1f4 = func_0x00400cb0(&UNK_004015d4); uStack_1f6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1f8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } puStack_48 = puStack_10; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_badSink(auStack_58); return; }
['gcc']
5,674
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109208/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,675
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_badSink(wchar_t * dataArray[]) { /* copy data out of dataArray */ wchar_t * data = dataArray[2]; { int i, n, intVariable; if (swscanf(data, L"%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); } } }
['/* copy data out of dataArray */', "/* 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/109208/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_badSink(long param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = *(undefined8 *)(param_1 + 0x10); iVar1 = func_0x00400ca0(uStack_18,&UNK_004015d4,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,676
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_goodG2BSink(wchar_t * dataArray[]) { wchar_t * data = dataArray[2]; { int i, n, intVariable; if (swscanf(data, L"%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/109208/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_goodG2BSink(long param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = *(undefined8 *)(param_1 + 0x10); iVar1 = func_0x00400ce0(uStack_18,&UNK_00401714,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,677
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_goodB2GSink(wchar_t * dataArray[]) { wchar_t * data = dataArray[2]; { int i, n, intVariable; if (swscanf(data, L"%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/109208/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_66b_goodB2GSink(long param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = *(undefined8 *)(param_1 + 0x10); iVar1 = func_0x00400ce0(uStack_18,&UNK_00401714,&iStack_1c); if ((iVar1 == 1) && (iStack_1c < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,678
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_bad() { wchar_t * data; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_structType myStruct; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myStruct.structFirst = data; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_badSink(myStruct); }
['/* 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/109209/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [48]; undefined8 *puStack_38; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015c4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } puStack_38 = puStack_10; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_badSink(puStack_10); return; }
['gcc']
5,679
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109209/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,680
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_badSink(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_structType myStruct) { wchar_t * data = myStruct.structFirst; { int i, n, intVariable; if (swscanf(data, L"%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/109209/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_badSink(undefined8 param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = param_1; iVar1 = func_0x00400ca0(param_1,&UNK_004015c4,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,681
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_goodG2BSink(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_structType myStruct) { wchar_t * data = myStruct.structFirst; { int i, n, intVariable; if (swscanf(data, L"%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/109209/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_goodG2BSink(undefined8 param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = param_1; iVar1 = func_0x00400ce0(param_1,&UNK_00401704,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,682
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_goodB2GSink(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67_structType myStruct) { wchar_t * data = myStruct.structFirst; { int i, n, intVariable; if (swscanf(data, L"%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/109209/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_67b_goodB2GSink(undefined8 param_1) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = param_1; iVar1 = func_0x00400ce0(param_1,&UNK_00401704,&iStack_1c); if ((iVar1 == 1) && (iStack_1c < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,683
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; wchar_t *replace; SOCKET connectSocket = INVALID_SOCKET; size_t dataLen = wcslen(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(wchar_t) * (100 - dataLen - 1), 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* Append null terminator */ data[dataLen + recvResult / sizeof(wchar_t)] = L'\0'; /* Eliminate CRLF */ replace = wcschr(data, L'\r'); if (replace) { *replace = L'\0'; } replace = wcschr(data, L'\n'); if (replace) { *replace = L'\0'; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_badData = data; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_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/109210/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; undefined2 uStack_1d8; undefined2 uStack_1d6; undefined4 uStack_1d4; undefined8 uStack_1c8; undefined8 uStack_1c0; undefined8 auStack_1b8 [49]; undefined4 *puStack_30; int iStack_24; long lStack_20; int iStack_14; undefined8 *puStack_10; uStack_1c8 = 0; uStack_1c0 = 0; puVar3 = auStack_1b8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_10 = &uStack_1c8; iStack_14 = 0xffffffff; lStack_20 = func_0x00400c50(puStack_10); iStack_14 = func_0x00400d40(2,1,6); if (iStack_14 != -1) { func_0x00400c60(&uStack_1d8,0,0x10); uStack_1d8 = 2; uStack_1d4 = func_0x00400cb0(&UNK_004015c4); uStack_1d6 = func_0x00400c30(0x6987); iVar1 = func_0x00400d10(iStack_14,&uStack_1d8,0x10); if (((iVar1 != -1) && (iStack_24 = func_0x00400c00(iStack_14,lStack_20 * 4 + (long)puStack_10,(99 - lStack_20) * 4 ,0), iStack_24 != -1)) && (iStack_24 != 0)) { *(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0; puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,0xd); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } puStack_30 = (undefined4 *)func_0x00400d00(puStack_10,10); if (puStack_30 != (undefined4 *)0x0) { *puStack_30 = 0; } } } if (iStack_14 != -1) { func_0x00400c70(iStack_14); } CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_badData = puStack_10; CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_badSink(); return; }
['gcc']
5,684
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109210/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68a.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_good
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
5,685
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_badSink() { wchar_t * data = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_badData; { int i, n, intVariable; if (swscanf(data, L"%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/109210/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_badSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_badSink(void) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_badData; iVar1 = func_0x00400ca0(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_badData, &UNK_004015c4,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,686
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_goodG2BSink() { wchar_t * data = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_goodG2BData; { int i, n, intVariable; if (swscanf(data, L"%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/109210/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_goodG2BSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_goodG2BSink(void) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_goodG2BData; iVar1 = func_0x00400ce0(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_goodG2BData, &UNK_00401704,&iStack_1c); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,687
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_goodB2GSink() { wchar_t * data = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_goodB2GData; { int i, n, intVariable; if (swscanf(data, L"%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/109210/CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b.c
CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_goodB2GSink
void CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68b_goodB2GSink(void) { int iVar1; int iStack_1c; undefined8 uStack_18; int iStack_10; int iStack_c; uStack_18 = CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_goodB2GData; iVar1 = func_0x00400ce0(CWE606_Unchecked_Loop_Condition__wchar_t_connect_socket_68_goodB2GData, &UNK_00401704,&iStack_1c); if ((iVar1 == 1) && (iStack_1c < 10000)) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1c; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,688
void CWE606_Unchecked_Loop_Condition__wchar_t_console_02_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; if(1) { { /* Read input from the console */ size_t dataLen = wcslen(data); /* if there is room in data, read into it from the console */ if (100-dataLen > 1) { /* POTENTIAL FLAW: Read data from the console */ if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL) { /* The next few lines remove the carriage return from the string that is * inserted by fgetws() */ dataLen = wcslen(data); if (dataLen > 0 && data[dataLen-1] == L'\n') { data[dataLen-1] = L'\0'; } } else { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } } } } if(1) { { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', "/* 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/109219/CWE606_Unchecked_Loop_Condition__wchar_t_console_02.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_02_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_console_02_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1bc; undefined8 uStack_1b8; undefined8 uStack_1b0; undefined8 auStack_1a8 [49]; long lStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1b8 = 0; uStack_1b0 = 0; puVar3 = auStack_1a8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1b8; lStack_20 = func_0x00400aa0(puStack_18); if (1 < 100U - lStack_20) { lVar2 = func_0x00400a60(lStack_20 * 4 + (long)puStack_18,100 - (int)lStack_20,stdin); if (lVar2 == 0) { printLine(&UNK_004012f4); *(undefined4 *)((long)puStack_18 + lStack_20 * 4) = 0; } else { lStack_20 = func_0x00400aa0(puStack_18); if ((lStack_20 != 0) && (*(int *)((long)puStack_18 + lStack_20 * 4 + -4) == 10)) { *(undefined4 *)((long)puStack_18 + lStack_20 * 4 + -4) = 0; } } } iVar1 = func_0x00400ad0(puStack_18,&UNK_00401304,&iStack_1bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,689
void CWE606_Unchecked_Loop_Condition__wchar_t_console_02_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109219/CWE606_Unchecked_Loop_Condition__wchar_t_console_02.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_02_good
void CWE606_Unchecked_Loop_Condition__wchar_t_console_02_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
5,690
void CWE606_Unchecked_Loop_Condition__wchar_t_console_03_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; if(5==5) { { /* Read input from the console */ size_t dataLen = wcslen(data); /* if there is room in data, read into it from the console */ if (100-dataLen > 1) { /* POTENTIAL FLAW: Read data from the console */ if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL) { /* The next few lines remove the carriage return from the string that is * inserted by fgetws() */ dataLen = wcslen(data); if (dataLen > 0 && data[dataLen-1] == L'\n') { data[dataLen-1] = L'\0'; } } else { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } } } } if(5==5) { { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', "/* 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/109220/CWE606_Unchecked_Loop_Condition__wchar_t_console_03.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_03_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_console_03_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1bc; undefined8 uStack_1b8; undefined8 uStack_1b0; undefined8 auStack_1a8 [49]; long lStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1b8 = 0; uStack_1b0 = 0; puVar3 = auStack_1a8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1b8; lStack_20 = func_0x00400aa0(puStack_18); if (1 < 100U - lStack_20) { lVar2 = func_0x00400a60(lStack_20 * 4 + (long)puStack_18,100 - (int)lStack_20,stdin); if (lVar2 == 0) { printLine(&UNK_004012f4); *(undefined4 *)((long)puStack_18 + lStack_20 * 4) = 0; } else { lStack_20 = func_0x00400aa0(puStack_18); if ((lStack_20 != 0) && (*(int *)((long)puStack_18 + lStack_20 * 4 + -4) == 10)) { *(undefined4 *)((long)puStack_18 + lStack_20 * 4 + -4) = 0; } } } iVar1 = func_0x00400ad0(puStack_18,&UNK_00401304,&iStack_1bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,691
void CWE606_Unchecked_Loop_Condition__wchar_t_console_03_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109220/CWE606_Unchecked_Loop_Condition__wchar_t_console_03.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_03_good
void CWE606_Unchecked_Loop_Condition__wchar_t_console_03_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
5,692
void CWE606_Unchecked_Loop_Condition__wchar_t_console_04_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; if(STATIC_CONST_TRUE) { { /* Read input from the console */ size_t dataLen = wcslen(data); /* if there is room in data, read into it from the console */ if (100-dataLen > 1) { /* POTENTIAL FLAW: Read data from the console */ if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL) { /* The next few lines remove the carriage return from the string that is * inserted by fgetws() */ dataLen = wcslen(data); if (dataLen > 0 && data[dataLen-1] == L'\n') { data[dataLen-1] = L'\0'; } } else { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } } } } if(STATIC_CONST_TRUE) { { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', "/* 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/109221/CWE606_Unchecked_Loop_Condition__wchar_t_console_04.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_04_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_console_04_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1bc; undefined8 uStack_1b8; undefined8 uStack_1b0; undefined8 auStack_1a8 [49]; long lStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1b8 = 0; uStack_1b0 = 0; puVar3 = auStack_1a8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1b8; lStack_20 = func_0x00400aa0(puStack_18); if (1 < 100U - lStack_20) { lVar2 = func_0x00400a60(lStack_20 * 4 + (long)puStack_18,100 - (int)lStack_20,stdin); if (lVar2 == 0) { printLine(&UNK_0040130c); *(undefined4 *)((long)puStack_18 + lStack_20 * 4) = 0; } else { lStack_20 = func_0x00400aa0(puStack_18); if ((lStack_20 != 0) && (*(int *)((long)puStack_18 + lStack_20 * 4 + -4) == 10)) { *(undefined4 *)((long)puStack_18 + lStack_20 * 4 + -4) = 0; } } } iVar1 = func_0x00400ad0(puStack_18,&UNK_0040131c,&iStack_1bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,693
void CWE606_Unchecked_Loop_Condition__wchar_t_console_04_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109221/CWE606_Unchecked_Loop_Condition__wchar_t_console_04.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_04_good
void CWE606_Unchecked_Loop_Condition__wchar_t_console_04_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
5,694
void CWE606_Unchecked_Loop_Condition__wchar_t_console_05_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; if(staticTrue) { { /* Read input from the console */ size_t dataLen = wcslen(data); /* if there is room in data, read into it from the console */ if (100-dataLen > 1) { /* POTENTIAL FLAW: Read data from the console */ if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL) { /* The next few lines remove the carriage return from the string that is * inserted by fgetws() */ dataLen = wcslen(data); if (dataLen > 0 && data[dataLen-1] == L'\n') { data[dataLen-1] = L'\0'; } } else { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } } } } if(staticTrue) { { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', "/* 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/109222/CWE606_Unchecked_Loop_Condition__wchar_t_console_05.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_05_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_console_05_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1bc; undefined8 uStack_1b8; undefined8 uStack_1b0; undefined8 auStack_1a8 [49]; long lStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1b8 = 0; uStack_1b0 = 0; puVar3 = auStack_1a8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1b8; if (staticTrue != 0) { lStack_20 = func_0x00400aa0(puStack_18); if (1 < 100U - lStack_20) { lVar2 = func_0x00400a60(lStack_20 * 4 + (long)puStack_18,100 - (int)lStack_20,stdin); if (lVar2 == 0) { printLine(&UNK_00401304); *(undefined4 *)((long)puStack_18 + lStack_20 * 4) = 0; } else { lStack_20 = func_0x00400aa0(puStack_18); if ((lStack_20 != 0) && (*(int *)((long)puStack_18 + lStack_20 * 4 + -4) == 10)) { *(undefined4 *)((long)puStack_18 + lStack_20 * 4 + -4) = 0; } } } } if (staticTrue != 0) { iVar1 = func_0x00400ad0(puStack_18,&UNK_00401314,&iStack_1bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } return; }
['gcc']
5,695
void CWE606_Unchecked_Loop_Condition__wchar_t_console_05_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109222/CWE606_Unchecked_Loop_Condition__wchar_t_console_05.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_05_good
void CWE606_Unchecked_Loop_Condition__wchar_t_console_05_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
5,696
void CWE606_Unchecked_Loop_Condition__wchar_t_console_06_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; if(STATIC_CONST_FIVE==5) { { /* Read input from the console */ size_t dataLen = wcslen(data); /* if there is room in data, read into it from the console */ if (100-dataLen > 1) { /* POTENTIAL FLAW: Read data from the console */ if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL) { /* The next few lines remove the carriage return from the string that is * inserted by fgetws() */ dataLen = wcslen(data); if (dataLen > 0 && data[dataLen-1] == L'\n') { data[dataLen-1] = L'\0'; } } else { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } } } } if(STATIC_CONST_FIVE==5) { { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', "/* 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/109223/CWE606_Unchecked_Loop_Condition__wchar_t_console_06.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_06_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_console_06_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1bc; undefined8 uStack_1b8; undefined8 uStack_1b0; undefined8 auStack_1a8 [49]; long lStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1b8 = 0; uStack_1b0 = 0; puVar3 = auStack_1a8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1b8; lStack_20 = func_0x00400aa0(puStack_18); if (1 < 100U - lStack_20) { lVar2 = func_0x00400a60(lStack_20 * 4 + (long)puStack_18,100 - (int)lStack_20,stdin); if (lVar2 == 0) { printLine(&UNK_00401308); *(undefined4 *)((long)puStack_18 + lStack_20 * 4) = 0; } else { lStack_20 = func_0x00400aa0(puStack_18); if ((lStack_20 != 0) && (*(int *)((long)puStack_18 + lStack_20 * 4 + -4) == 10)) { *(undefined4 *)((long)puStack_18 + lStack_20 * 4 + -4) = 0; } } } iVar1 = func_0x00400ad0(puStack_18,&UNK_00401318,&iStack_1bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } return; }
['gcc']
5,697
void CWE606_Unchecked_Loop_Condition__wchar_t_console_06_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109223/CWE606_Unchecked_Loop_Condition__wchar_t_console_06.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_06_good
void CWE606_Unchecked_Loop_Condition__wchar_t_console_06_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
5,698
void CWE606_Unchecked_Loop_Condition__wchar_t_console_07_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; if(staticFive==5) { { /* Read input from the console */ size_t dataLen = wcslen(data); /* if there is room in data, read into it from the console */ if (100-dataLen > 1) { /* POTENTIAL FLAW: Read data from the console */ if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL) { /* The next few lines remove the carriage return from the string that is * inserted by fgetws() */ dataLen = wcslen(data); if (dataLen > 0 && data[dataLen-1] == L'\n') { data[dataLen-1] = L'\0'; } } else { printLine("fgetws() failed"); /* Restore NUL terminator if fgetws fails */ data[dataLen] = L'\0'; } } } } if(staticFive==5) { { int i, n, intVariable; if (swscanf(data, L"%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); } } } }
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', "/* 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/109224/CWE606_Unchecked_Loop_Condition__wchar_t_console_07.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_07_bad
void CWE606_Unchecked_Loop_Condition__wchar_t_console_07_bad(void) { int iVar1; long lVar2; undefined8 *puVar3; int iStack_1bc; undefined8 uStack_1b8; undefined8 uStack_1b0; undefined8 auStack_1a8 [49]; long lStack_20; undefined8 *puStack_18; int iStack_10; int iStack_c; uStack_1b8 = 0; uStack_1b0 = 0; puVar3 = auStack_1a8; for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) { *puVar3 = 0; puVar3 = puVar3 + 1; } puStack_18 = &uStack_1b8; if (staticFive == 5) { lStack_20 = func_0x00400aa0(puStack_18); if (1 < 100U - lStack_20) { lVar2 = func_0x00400a60(lStack_20 * 4 + (long)puStack_18,100 - (int)lStack_20,stdin); if (lVar2 == 0) { printLine(&UNK_00401304); *(undefined4 *)((long)puStack_18 + lStack_20 * 4) = 0; } else { lStack_20 = func_0x00400aa0(puStack_18); if ((lStack_20 != 0) && (*(int *)((long)puStack_18 + lStack_20 * 4 + -4) == 10)) { *(undefined4 *)((long)puStack_18 + lStack_20 * 4 + -4) = 0; } } } } if (staticFive == 5) { iVar1 = func_0x00400ad0(puStack_18,&UNK_00401314,&iStack_1bc); if (iVar1 == 1) { iStack_10 = 0; for (iStack_c = 0; iStack_c < iStack_1bc; iStack_c = iStack_c + 1) { iStack_10 = iStack_10 + 1; } printIntLine(iStack_10); } } return; }
['gcc']
5,699
void CWE606_Unchecked_Loop_Condition__wchar_t_console_07_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/109224/CWE606_Unchecked_Loop_Condition__wchar_t_console_07.c
CWE606_Unchecked_Loop_Condition__wchar_t_console_07_good
void CWE606_Unchecked_Loop_Condition__wchar_t_console_07_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']