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
46,800
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_31_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86354/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_31.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_31_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_31_good(void) { goodG2B(); return; }
['gcc']
46,801
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32_bad() { short data; short *dataPtr1 = &data; short *dataPtr2 = &data; /* Initialize data */ data = 0; { short data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { short data = *dataPtr2; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86355/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32_bad(void) { int iVar1; undefined auStack_128 [99]; undefined uStack_c5; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined auStack_50 [8]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; short sStack_30; short sStack_2e; int iStack_2c; int iStack_28; int iStack_24; short *psStack_20; short *psStack_18; short sStack_a; psStack_18 = &sStack_30; psStack_20 = &sStack_30; sStack_30 = 0; sStack_a = 0; iStack_24 = 0xffffffff; iStack_24 = func_0x00400d60(2,1,6); if (iStack_24 != -1) { func_0x00400c70(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = func_0x00400cc0(&UNK_004015d4); uStack_46 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_24,&uStack_48,0x10); if (((iVar1 != -1) && (iStack_28 = func_0x00400c20(iStack_24,auStack_50,7,0), iStack_28 != -1)) && (iStack_28 != 0)) { auStack_50[iStack_28] = 0; iStack_2c = func_0x00400d20(auStack_50); if ((iStack_2c < 0x8000) && (-0x8001 < iStack_2c)) { sStack_a = (short)iStack_2c; } else { sStack_a = -1; } } } if (iStack_24 != -1) { func_0x00400c80(iStack_24); } *psStack_18 = sStack_a; sStack_2e = *psStack_20; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; func_0x00400c70(auStack_128,0x41,99); uStack_c5 = 0; if (sStack_2e < 100) { func_0x00400ce0(&uStack_b8,auStack_128,(long)sStack_2e); *(undefined *)((long)&uStack_b8 + (long)(int)sStack_2e) = 0; } printLine(&uStack_b8); return; }
['gcc']
46,802
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86355/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_32_good(void) { goodG2B(); return; }
['gcc']
46,803
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_bad() { short data; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_unionType myUnion; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { short data = myUnion.unionSecond; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86357/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; short sStack_1c; short sStack_1a; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cc0(&UNK_004015a4); uStack_36 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_40,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_40[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_40); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } sStack_1c = sStack_a; sStack_1a = sStack_a; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400c70(auStack_118,0x41,99); uStack_b5 = 0; if (sStack_1a < 100) { func_0x00400ce0(&uStack_a8,auStack_118,(long)sStack_1a); *(undefined *)((long)&uStack_a8 + (long)(int)sStack_1a) = 0; } printLine(&uStack_a8); return; }
['gcc']
46,804
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86357/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_34_good(void) { goodG2B(); return; }
['gcc']
46,805
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_badSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86358/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,806
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_badSink(data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86358/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_badSink((int)sStack_a); return; }
['gcc']
46,807
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_goodG2BSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86358/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,808
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86358/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_41_good(void) { goodG2B(); return; }
['gcc']
46,809
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42_bad() { short data; /* Initialize data */ data = 0; data = badSource(data); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86359/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42_bad(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = 0; sStack_a = badSource(0); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,810
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86359/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_42_good(void) { goodG2B(); return; }
['gcc']
46,811
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44_bad() { short data; /* define a function pointer */ void (*funcPtr) (short) = badSink; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* use the function pointer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86361/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_24; int iStack_20; int iStack_1c; code *pcStack_18; short sStack_a; pcStack_18 = badSink; sStack_a = 0; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d60(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cc0(&UNK_004015b4); uStack_36 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c20(iStack_1c,auStack_40,7,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_40[iStack_20] = 0; iStack_24 = func_0x00400d20(auStack_40); if ((iStack_24 < 0x8000) && (-0x8001 < iStack_24)) { sStack_a = (short)iStack_24; } else { sStack_a = -1; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } (*pcStack_18)((int)sStack_a); return; }
['gcc']
46,812
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86361/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_44_good(void) { goodG2B(); return; }
['gcc']
46,813
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_badData = data; badSink(); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86362/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015b4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { uStack_a = (undefined2)iStack_18; } else { uStack_a = 0xffff; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_badData = uStack_a; badSink(); return; }
['gcc']
46,814
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86362/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_45_good(void) { goodG2B(); return; }
['gcc']
46,815
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_badSink(data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86363/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_badSink((int)sStack_a); return; }
['gcc']
46,816
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86363/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51_good(void) { goodG2B(); return; }
['gcc']
46,817
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_badSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86363/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,818
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_goodG2BSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86363/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_51b_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,819
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_badSink(data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86364/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015c4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_badSink((int)sStack_a); return; }
['gcc']
46,820
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86364/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52_good(void) { goodG2B(); return; }
['gcc']
46,821
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_badSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86364/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_badSink((int)param_1); return; }
['gcc']
46,822
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86364/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_goodG2BSink((int)param_1); return; }
['gcc']
46,823
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_badSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86364/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,824
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_goodG2BSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86364/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_52c_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,825
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_badSink(data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015e4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_badSink((int)sStack_a); return; }
['gcc']
46,826
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53_good(void) { goodG2B(); return; }
['gcc']
46,827
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_badSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_badSink((int)param_1); return; }
['gcc']
46,828
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_goodG2BSink((int)param_1); return; }
['gcc']
46,829
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_badSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_badSink((int)param_1); return; }
['gcc']
46,830
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53c_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_goodG2BSink((int)param_1); return; }
['gcc']
46,831
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_badSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,832
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_goodG2BSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86365/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_53d_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,833
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_badSink(data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_00401604); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_badSink((int)sStack_a); return; }
['gcc']
46,834
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54_good(void) { goodG2B(); return; }
['gcc']
46,835
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_badSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_badSink((int)param_1); return; }
['gcc']
46,836
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_goodG2BSink((int)param_1); return; }
['gcc']
46,837
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_badSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_badSink((int)param_1); return; }
['gcc']
46,838
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54c_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_goodG2BSink((int)param_1); return; }
['gcc']
46,839
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_badSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_badSink((int)param_1); return; }
['gcc']
46,840
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54d_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_goodG2BSink((int)param_1); return; }
['gcc']
46,841
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_badSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,842
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_goodG2BSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86366/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_54e_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,843
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61_bad() { short data; /* Initialize data */ data = 0; data = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_badSource(data); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86367/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61_bad(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = 0; sStack_a = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_badSource(0); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,844
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86367/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61_good(void) { goodG2B(); return; }
['gcc']
46,845
short CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_badSource(short data) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } return data; }
['/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86367/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_badSource
undefined2 CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_badSource(undefined2 param_1) { int iVar1; undefined2 uStack_3c; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; int iStack_c; iStack_c = 0xffffffff; iStack_c = func_0x00400d60(2,1,6); uStack_3c = param_1; if (iStack_c != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c20(iStack_c,auStack_30,7,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_30[iStack_10] = 0; iStack_14 = func_0x00400d20(auStack_30); if ((iStack_14 < 0x8000) && (-0x8001 < iStack_14)) { uStack_3c = (undefined2)iStack_14; } else { uStack_3c = 0xffff; } } } if (iStack_c != -1) { func_0x00400c80(iStack_c); } return uStack_3c; }
['gcc']
46,846
short CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_goodG2BSource(short data) { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; return data; }
['/* FIX: Use a positive integer less than &InitialDataSize&*/']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86367/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_goodG2BSource
undefined2 CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_61b_goodG2BSource(void) { return 99; }
['gcc']
46,847
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_badSink(&data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86369/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined2 uStack_16; int iStack_14; int iStack_10; int iStack_c; uStack_16 = 0; iStack_c = 0xffffffff; iStack_c = func_0x00400d60(2,1,6); if (iStack_c != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015b4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c20(iStack_c,auStack_30,7,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_30[iStack_10] = 0; iStack_14 = func_0x00400d20(auStack_30); if ((iStack_14 < 0x8000) && (-0x8001 < iStack_14)) { uStack_16 = (undefined2)iStack_14; } else { uStack_16 = 0xffff; } } } if (iStack_c != -1) { func_0x00400c80(iStack_c); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_badSink(&uStack_16); return; }
['gcc']
46,848
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86369/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63_good(void) { goodG2B(); return; }
['gcc']
46,849
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_badSink(short * dataPtr) { short data = *dataPtr; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86369/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_badSink(short *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,850
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_goodG2BSink(short * dataPtr) { short data = *dataPtr; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86369/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_63b_goodG2BSink(short *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,851
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_badSink(&data); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86370/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined2 uStack_16; int iStack_14; int iStack_10; int iStack_c; uStack_16 = 0; iStack_c = 0xffffffff; iStack_c = func_0x00400d60(2,1,6); if (iStack_c != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015b4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_c,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_10 = func_0x00400c20(iStack_c,auStack_30,7,0), iStack_10 != -1)) && (iStack_10 != 0)) { auStack_30[iStack_10] = 0; iStack_14 = func_0x00400d20(auStack_30); if ((iStack_14 < 0x8000) && (-0x8001 < iStack_14)) { uStack_16 = (undefined2)iStack_14; } else { uStack_16 = 0xffff; } } } if (iStack_c != -1) { func_0x00400c80(iStack_c); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_badSink(&uStack_16); return; }
['gcc']
46,852
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86370/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64_good(void) { goodG2B(); return; }
['gcc']
46,853
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ short * dataPtr = (short *)dataVoidPtr; /* dereference dataPtr into data */ short data = (*dataPtr); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86370/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_badSink(short *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_12; short *psStack_10; sStack_12 = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; psStack_10 = param_1; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_12 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_12); *(undefined *)((long)&uStack_78 + (long)(int)sStack_12) = 0; } printLine(&uStack_78); return; }
['gcc']
46,854
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ short * dataPtr = (short *)dataVoidPtr; /* dereference dataPtr into data */ short data = (*dataPtr); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86370/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_64b_goodG2BSink(short *param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_12; short *psStack_10; sStack_12 = *param_1; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; psStack_10 = param_1; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_12 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)sStack_12); *(undefined *)((long)&uStack_78 + (long)(int)sStack_12) = 0; } printLine(&uStack_78); return; }
['gcc']
46,855
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65_bad() { short data; /* define a function pointer */ void (*funcPtr) (short) = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_badSink; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* use the function pointer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86371/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_24; int iStack_20; int iStack_1c; code *pcStack_18; short sStack_a; pcStack_18 = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_badSink; sStack_a = 0; iStack_1c = 0xffffffff; iStack_1c = func_0x00400d60(2,1,6); if (iStack_1c != -1) { func_0x00400c70(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cc0(&UNK_004015b4); uStack_36 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400c20(iStack_1c,auStack_40,7,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_40[iStack_20] = 0; iStack_24 = func_0x00400d20(auStack_40); if ((iStack_24 < 0x8000) && (-0x8001 < iStack_24)) { sStack_a = (short)iStack_24; } else { sStack_a = -1; } } } if (iStack_1c != -1) { func_0x00400c80(iStack_1c); } (*pcStack_18)((int)sStack_a); return; }
['gcc']
46,856
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86371/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65_good(void) { goodG2B(); return; }
['gcc']
46,857
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_badSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86371/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,858
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_goodG2BSink(short data) { { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86371/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_65b_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
46,859
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66_bad() { short data; short dataArray[5]; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* put data in array */ dataArray[2] = data; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_badSink(dataArray); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* put data in array */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86372/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined auStack_22 [4]; undefined2 uStack_1e; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cc0(&UNK_004015b4); uStack_36 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_40,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_40[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_40); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { uStack_a = (undefined2)iStack_18; } else { uStack_a = 0xffff; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_1e = uStack_a; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_badSink(auStack_22); return; }
['gcc']
46,860
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86372/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66_good(void) { goodG2B(); return; }
['gcc']
46,861
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_badSink(short dataArray[]) { /* copy data out of dataArray */ short data = dataArray[2]; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* copy data out of dataArray */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86372/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_badSink(long param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = *(short *)(param_1 + 4); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,862
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_goodG2BSink(short dataArray[]) { short data = dataArray[2]; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86372/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_66b_goodG2BSink(long param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = *(short *)(param_1 + 4); uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,863
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_bad() { short data; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_structType myStruct; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myStruct.structFirst = data; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_badSink(myStruct); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86373/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined2 uStack_1a; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400cc0(&UNK_004015b4); uStack_36 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_40,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_40[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_40); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { uStack_a = (undefined2)iStack_18; } else { uStack_a = 0xffff; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_1a = uStack_a; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_badSink(uStack_a); return; }
['gcc']
46,864
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86373/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_good(void) { goodG2B(); return; }
['gcc']
46,865
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_badSink(CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_structType myStruct) { short data = myStruct.structFirst; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86373/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_badSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; sStack_a = param_1; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,866
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_goodG2BSink(CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67_structType myStruct) { short data = myStruct.structFirst; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86373/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_67b_goodG2BSink(short param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; sStack_a = param_1; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,867
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_badData = data; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_badSink(); }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86374/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_bad(void) { int iVar1; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015b4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { uStack_a = (undefined2)iStack_18; } else { uStack_a = 0xffff; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_badData = uStack_a; CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_badSink(); return; }
['gcc']
46,868
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86374/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68a.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_good(void) { goodG2B(); return; }
['gcc']
46,869
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_badSink() { short data = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_badData; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86374/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_badSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_badSink(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_badData; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400c70(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,870
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_goodG2BSink() { short data = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_goodG2BData; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86374/CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b.c
CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68b_goodG2BSink(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; short sStack_a; sStack_a = CWE194_Unexpected_Sign_Extension__connect_socket_memcpy_68_goodG2BData; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
46,871
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01_bad() { short data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86382/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_00401594); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,872
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86382/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_01_good(void) { goodG2B(); return; }
['gcc']
46,873
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02_bad() { short data; /* Initialize data */ data = 0; if(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86383/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_00401594); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,874
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86383/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_02_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,875
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03_bad() { short data; /* Initialize data */ data = 0; if(5==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86384/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_00401594); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,876
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86384/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,877
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04_bad() { short data; /* Initialize data */ data = 0; if(STATIC_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86385/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015ac); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,878
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86385/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,879
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05_bad() { short data; /* Initialize data */ data = 0; if(staticTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86386/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; if (staticTrue != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,880
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86386/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,881
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_bad() { short data; /* Initialize data */ data = 0; if(staticFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86388/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; if (staticFive == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,882
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86388/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_07_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,883
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08_bad() { short data; /* Initialize data */ data = 0; if(staticReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86389/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015c4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,884
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86389/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_08_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,885
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09_bad() { short data; /* Initialize data */ data = 0; if(GLOBAL_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86390/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; if (GLOBAL_CONST_TRUE != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,886
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86390/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_09_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,887
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10_bad() { short data; /* Initialize data */ data = 0; if(globalTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86391/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; if (globalTrue != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,888
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86391/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_10_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,889
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11_bad() { short data; /* Initialize data */ data = 0; if(globalReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86392/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,890
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86392/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_11_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,891
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12_bad() { short data; /* Initialize data */ data = 0; if(globalReturnsTrueOrFalse()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } else { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* FIX: Use a positive integer less than &InitialDataSize&*/', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86393/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { sStack_a = 99; } else { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015b4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,892
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86393/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_12_good(void) { goodG2B(); return; }
['gcc']
46,893
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13_bad() { short data; /* Initialize data */ data = 0; if(GLOBAL_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86394/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; if (GLOBAL_CONST_FIVE == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,894
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86394/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_13_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,895
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14_bad() { short data; /* Initialize data */ data = 0; if(globalFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86395/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; if (globalFive == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_004015a4); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1) ) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,896
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86395/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_14_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,897
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15_bad() { short data; /* Initialize data */ data = 0; switch(6) { case 6: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86396/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_00401594); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']
46,898
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86396/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15_good
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_15_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
46,899
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_16_bad() { short data; /* Initialize data */ data = 0; while(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif 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 */ /* FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to short - ensure int to short conversion will be successful and if * not ensure that data will be negative */ tempInt = atoi(inputBuffer); if (tempInt > SHRT_MAX || tempInt < SHRT_MIN) { data = -1; } else { data = tempInt; } } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign extension could result in a very large number */ memmove(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* 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 */', '/* FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to short - ensure int to short conversion will be successful and if\r\n * not ensure that data will be negative */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */', '/* NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/86397/CWE194_Unexpected_Sign_Extension__connect_socket_memmove_16.c
CWE194_Unexpected_Sign_Extension__connect_socket_memmove_16_bad
void CWE194_Unexpected_Sign_Extension__connect_socket_memmove_16_bad(void) { int iVar1; undefined auStack_108 [99]; undefined uStack_a5; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; undefined auStack_30 [8]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; short sStack_a; sStack_a = 0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400d60(2,1,6); if (iStack_10 != -1) { func_0x00400c70(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400cc0(&UNK_00401594); uStack_26 = func_0x00400c50(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400c20(iStack_10,auStack_30,7,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_30[iStack_14] = 0; iStack_18 = func_0x00400d20(auStack_30); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { sStack_a = (short)iStack_18; } else { sStack_a = -1; } } } if (iStack_10 != -1) { func_0x00400c80(iStack_10); } uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; func_0x00400c70(auStack_108,0x41,99); uStack_a5 = 0; if (sStack_a < 100) { func_0x00400ce0(&uStack_98,auStack_108,(long)sStack_a); *(undefined *)((long)&uStack_98 + (long)(int)sStack_a) = 0; } printLine(&uStack_98); return; }
['gcc']