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
48,400
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87041/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63_good
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63_good(void) { goodG2B(); return; }
['gcc']
48,401
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87041/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63b_badSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400c90(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400c40(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,402
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87041/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_63b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,403
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); /* FLAW: Use a value input from the network */ 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 (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64b_badSink(&data); }
['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* 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/87042/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64_bad
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64_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; int iStack_c; uStack_1a = 0; iStack_10 = 0xffffffff; iStack_c = -1; iStack_10 = func_0x00400d80(2,1,6); if (iStack_10 != -1) { func_0x00400c90(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d30(iStack_10,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d20(iStack_10,5), iVar1 != -1)) && (iStack_c = func_0x00400d40(iStack_10,0,0), iStack_c != -1)) && ((iStack_14 = func_0x00400c30(iStack_c,auStack_40,7,0), iStack_14 != -1 && (iStack_14 != 0))) ) { auStack_40[iStack_14] = 0; iStack_18 = func_0x00400d50(auStack_40); if ((iStack_18 < 0x8000) && (-0x8001 < iStack_18)) { uStack_1a = (undefined2)iStack_18; } else { uStack_1a = 0xffff; } } } if (iStack_10 != -1) { func_0x00400ca0(iStack_10); } if (iStack_c != -1) { func_0x00400ca0(iStack_c); } CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64b_badSink(&uStack_1a); return; }
['gcc']
48,404
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87042/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64_good
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64_good(void) { goodG2B(); return; }
['gcc']
48,405
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87042/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64b_badSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400c90(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_12 < 100) { func_0x00400c40(&uStack_78,auStack_e8,(long)sStack_12); *(undefined *)((long)&uStack_78 + (long)(int)sStack_12) = 0; } printLine(&uStack_78); return; }
['gcc']
48,406
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87042/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_64b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)sStack_12); *(undefined *)((long)&uStack_78 + (long)(int)sStack_12) = 0; } printLine(&uStack_78); return; }
['gcc']
48,407
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65_bad() { short data; /* define a function pointer */ void (*funcPtr) (short) = CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65b_badSink; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); /* FLAW: Use a value input from the network */ 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 (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* Abort on error or the connection was closed */', '/* 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/87043/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65_bad
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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; int iStack_10; short sStack_a; pcStack_18 = CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65b_badSink; sStack_a = 0; iStack_1c = 0xffffffff; iStack_10 = -1; iStack_1c = func_0x00400d80(2,1,6); if (iStack_1c != -1) { func_0x00400c90(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d30(iStack_1c,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d20(iStack_1c,5), iVar1 != -1)) && (iStack_10 = func_0x00400d40(iStack_1c,0,0), iStack_10 != -1)) && ((iStack_20 = func_0x00400c30(iStack_10,auStack_40,7,0), iStack_20 != -1 && (iStack_20 != 0)) )) { auStack_40[iStack_20] = 0; iStack_24 = func_0x00400d50(auStack_40); if ((iStack_24 < 0x8000) && (-0x8001 < iStack_24)) { sStack_a = (short)iStack_24; } else { sStack_a = -1; } } } if (iStack_1c != -1) { func_0x00400ca0(iStack_1c); } if (iStack_10 != -1) { func_0x00400ca0(iStack_10); } (*pcStack_18)((int)sStack_a); return; }
['gcc']
48,408
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87043/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65_good
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65_good(void) { goodG2B(); return; }
['gcc']
48,409
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87043/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65b_badSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400c90(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400c40(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
48,410
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87043/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_65b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)(int)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
48,411
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); /* FLAW: Use a value input from the network */ 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 (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* put data in array */ dataArray[2] = data; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66b_badSink(dataArray); }
['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* 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/87044/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66_bad
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined auStack_26 [4]; undefined2 uStack_22; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400c90(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d30(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d20(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d40(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c30(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0)) )) { auStack_40[iStack_18] = 0; iStack_1c = func_0x00400d50(auStack_40); if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) { uStack_a = (undefined2)iStack_1c; } else { uStack_a = 0xffff; } } } if (iStack_14 != -1) { func_0x00400ca0(iStack_14); } if (iStack_10 != -1) { func_0x00400ca0(iStack_10); } uStack_22 = uStack_a; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66b_badSink(auStack_26); return; }
['gcc']
48,412
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87044/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66_good
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66_good(void) { goodG2B(); return; }
['gcc']
48,413
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87044/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66b_badSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400c90(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400c40(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,414
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87044/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_66b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,415
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_bad() { short data; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_structType myStruct; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; int tempInt; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); /* FLAW: Use a value input from the network */ 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 (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myStruct.structFirst = data; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b_badSink(myStruct); }
['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* 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/87045/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_bad
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined2 uStack_1e; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400c90(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d30(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d20(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d40(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c30(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0)) )) { auStack_40[iStack_18] = 0; iStack_1c = func_0x00400d50(auStack_40); if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) { uStack_a = (undefined2)iStack_1c; } else { uStack_a = 0xffff; } } } if (iStack_14 != -1) { func_0x00400ca0(iStack_14); } if (iStack_10 != -1) { func_0x00400ca0(iStack_10); } uStack_1e = uStack_a; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b_badSink(uStack_a); return; }
['gcc']
48,416
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87045/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_good
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67_good(void) { goodG2B(); return; }
['gcc']
48,417
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b_badSink(CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87045/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b_badSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400c90(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400c40(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,418
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b_goodG2BSink(CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87045/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_67b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,419
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); /* FLAW: Use a value input from the network */ 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 (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_badData = data; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b_badSink(); }
['/* Initialize data */', '/* Abort on error or the connection was closed */', '/* 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/87046/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_bad
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_bad(void) { int iVar1; undefined auStack_40 [8]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; undefined2 uStack_a; uStack_a = 0; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400d80(2,1,6); if (iStack_14 != -1) { func_0x00400c90(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c70(0x6987); iVar1 = func_0x00400d30(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d20(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d40(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c30(iStack_10,auStack_40,7,0), iStack_18 != -1 && (iStack_18 != 0)) )) { auStack_40[iStack_18] = 0; iStack_1c = func_0x00400d50(auStack_40); if ((iStack_1c < 0x8000) && (-0x8001 < iStack_1c)) { uStack_a = (undefined2)iStack_1c; } else { uStack_a = 0xffff; } } } if (iStack_14 != -1) { func_0x00400ca0(iStack_14); } if (iStack_10 != -1) { func_0x00400ca0(iStack_10); } CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_badData = uStack_a; CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b_badSink(); return; }
['gcc']
48,420
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87046/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68a.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_good
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68_good(void) { goodG2B(); return; }
['gcc']
48,421
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b_badSink() { short data = CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87046/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b_badSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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__listen_socket_strncpy_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_0x00400c90(auStack_e8,0x41,99); uStack_85 = 0; if (sStack_a < 100) { func_0x00400c40(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,422
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b_goodG2BSink() { short data = CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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 */ strncpy(dest, source, data); dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87046/CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b.c
CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_68b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__listen_socket_strncpy_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__listen_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)sStack_a); *(undefined *)((long)&uStack_78 + (long)(int)sStack_a) = 0; } printLine(&uStack_78); return; }
['gcc']
48,423
void CWE194_Unexpected_Sign_Extension__negative_malloc_01_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87054/CWE194_Unexpected_Sign_Extension__negative_malloc_01.c
CWE194_Unexpected_Sign_Extension__negative_malloc_01_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_01_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,424
void CWE194_Unexpected_Sign_Extension__negative_malloc_01_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87054/CWE194_Unexpected_Sign_Extension__negative_malloc_01.c
CWE194_Unexpected_Sign_Extension__negative_malloc_01_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_01_good(void) { goodG2B(); return; }
['gcc']
48,425
void CWE194_Unexpected_Sign_Extension__negative_malloc_02_bad() { short data; /* Initialize data */ data = 0; if(1) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87055/CWE194_Unexpected_Sign_Extension__negative_malloc_02.c
CWE194_Unexpected_Sign_Extension__negative_malloc_02_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_02_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,426
void CWE194_Unexpected_Sign_Extension__negative_malloc_02_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87055/CWE194_Unexpected_Sign_Extension__negative_malloc_02.c
CWE194_Unexpected_Sign_Extension__negative_malloc_02_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_02_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,427
void CWE194_Unexpected_Sign_Extension__negative_malloc_03_bad() { short data; /* Initialize data */ data = 0; if(5==5) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87056/CWE194_Unexpected_Sign_Extension__negative_malloc_03.c
CWE194_Unexpected_Sign_Extension__negative_malloc_03_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_03_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,428
void CWE194_Unexpected_Sign_Extension__negative_malloc_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87056/CWE194_Unexpected_Sign_Extension__negative_malloc_03.c
CWE194_Unexpected_Sign_Extension__negative_malloc_03_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,429
void CWE194_Unexpected_Sign_Extension__negative_malloc_04_bad() { short data; /* Initialize data */ data = 0; if(STATIC_CONST_TRUE) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87057/CWE194_Unexpected_Sign_Extension__negative_malloc_04.c
CWE194_Unexpected_Sign_Extension__negative_malloc_04_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_04_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,430
void CWE194_Unexpected_Sign_Extension__negative_malloc_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87057/CWE194_Unexpected_Sign_Extension__negative_malloc_04.c
CWE194_Unexpected_Sign_Extension__negative_malloc_04_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,431
void CWE194_Unexpected_Sign_Extension__negative_malloc_05_bad() { short data; /* Initialize data */ data = 0; if(staticTrue) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87058/CWE194_Unexpected_Sign_Extension__negative_malloc_05.c
CWE194_Unexpected_Sign_Extension__negative_malloc_05_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_05_bad(void) { long lVar1; short sStack_a; sStack_a = 0; if (staticTrue != 0) { sStack_a = -1; } if (sStack_a < 100) { lVar1 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar1,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar1 + (long)sStack_a + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,432
void CWE194_Unexpected_Sign_Extension__negative_malloc_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87058/CWE194_Unexpected_Sign_Extension__negative_malloc_05.c
CWE194_Unexpected_Sign_Extension__negative_malloc_05_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,433
void CWE194_Unexpected_Sign_Extension__negative_malloc_06_bad() { short data; /* Initialize data */ data = 0; if(STATIC_CONST_FIVE==5) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87059/CWE194_Unexpected_Sign_Extension__negative_malloc_06.c
CWE194_Unexpected_Sign_Extension__negative_malloc_06_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_06_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,434
void CWE194_Unexpected_Sign_Extension__negative_malloc_06_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87059/CWE194_Unexpected_Sign_Extension__negative_malloc_06.c
CWE194_Unexpected_Sign_Extension__negative_malloc_06_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_06_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,435
void CWE194_Unexpected_Sign_Extension__negative_malloc_07_bad() { short data; /* Initialize data */ data = 0; if(staticFive==5) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87060/CWE194_Unexpected_Sign_Extension__negative_malloc_07.c
CWE194_Unexpected_Sign_Extension__negative_malloc_07_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_07_bad(void) { long lVar1; short sStack_a; sStack_a = 0; if (staticFive == 5) { sStack_a = -1; } if (sStack_a < 100) { lVar1 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar1,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar1 + (long)sStack_a + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,436
void CWE194_Unexpected_Sign_Extension__negative_malloc_07_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87060/CWE194_Unexpected_Sign_Extension__negative_malloc_07.c
CWE194_Unexpected_Sign_Extension__negative_malloc_07_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_07_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,437
void CWE194_Unexpected_Sign_Extension__negative_malloc_08_bad() { short data; /* Initialize data */ data = 0; if(staticReturnsTrue()) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87061/CWE194_Unexpected_Sign_Extension__negative_malloc_08.c
CWE194_Unexpected_Sign_Extension__negative_malloc_08_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_08_bad(void) { int iVar1; long lVar2; short sStack_a; sStack_a = 0; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { sStack_a = -1; } if (sStack_a < 100) { lVar2 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar2,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar2 + (long)sStack_a + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,438
void CWE194_Unexpected_Sign_Extension__negative_malloc_08_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87061/CWE194_Unexpected_Sign_Extension__negative_malloc_08.c
CWE194_Unexpected_Sign_Extension__negative_malloc_08_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_08_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,439
void CWE194_Unexpected_Sign_Extension__negative_malloc_09_bad() { short data; /* Initialize data */ data = 0; if(GLOBAL_CONST_TRUE) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87062/CWE194_Unexpected_Sign_Extension__negative_malloc_09.c
CWE194_Unexpected_Sign_Extension__negative_malloc_09_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_09_bad(void) { long lVar1; short sStack_a; sStack_a = 0; if (GLOBAL_CONST_TRUE != 0) { sStack_a = -1; } if (sStack_a < 100) { lVar1 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar1,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar1 + (long)sStack_a + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,440
void CWE194_Unexpected_Sign_Extension__negative_malloc_09_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87062/CWE194_Unexpected_Sign_Extension__negative_malloc_09.c
CWE194_Unexpected_Sign_Extension__negative_malloc_09_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_09_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,441
void CWE194_Unexpected_Sign_Extension__negative_malloc_10_bad() { short data; /* Initialize data */ data = 0; if(globalTrue) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87063/CWE194_Unexpected_Sign_Extension__negative_malloc_10.c
CWE194_Unexpected_Sign_Extension__negative_malloc_10_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_10_bad(void) { long lVar1; short sStack_a; sStack_a = 0; if (globalTrue != 0) { sStack_a = -1; } if (sStack_a < 100) { lVar1 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar1,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar1 + (long)sStack_a + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,442
void CWE194_Unexpected_Sign_Extension__negative_malloc_10_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87063/CWE194_Unexpected_Sign_Extension__negative_malloc_10.c
CWE194_Unexpected_Sign_Extension__negative_malloc_10_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_10_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,443
void CWE194_Unexpected_Sign_Extension__negative_malloc_11_bad() { short data; /* Initialize data */ data = 0; if(globalReturnsTrue()) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87064/CWE194_Unexpected_Sign_Extension__negative_malloc_11.c
CWE194_Unexpected_Sign_Extension__negative_malloc_11_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_11_bad(void) { int iVar1; long lVar2; short sStack_a; sStack_a = 0; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { sStack_a = -1; } if (sStack_a < 100) { lVar2 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar2,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar2 + (long)sStack_a + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,444
void CWE194_Unexpected_Sign_Extension__negative_malloc_11_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87064/CWE194_Unexpected_Sign_Extension__negative_malloc_11.c
CWE194_Unexpected_Sign_Extension__negative_malloc_11_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_11_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,445
void CWE194_Unexpected_Sign_Extension__negative_malloc_12_bad() { short data; /* Initialize data */ data = 0; if(globalReturnsTrueOrFalse()) { /* FLAW: Use a negative number */ data = -1; } else { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* FIX: Use a positive integer less than &InitialDataSize&*/', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87065/CWE194_Unexpected_Sign_Extension__negative_malloc_12.c
CWE194_Unexpected_Sign_Extension__negative_malloc_12_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_12_bad(void) { int iVar1; long lVar2; short sStack_a; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { sStack_a = 99; } else { sStack_a = -1; } if (sStack_a < 100) { lVar2 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar2,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar2 + (long)sStack_a + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,446
void CWE194_Unexpected_Sign_Extension__negative_malloc_12_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87065/CWE194_Unexpected_Sign_Extension__negative_malloc_12.c
CWE194_Unexpected_Sign_Extension__negative_malloc_12_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_12_good(void) { goodG2B(); return; }
['gcc']
48,447
void CWE194_Unexpected_Sign_Extension__negative_malloc_13_bad() { short data; /* Initialize data */ data = 0; if(GLOBAL_CONST_FIVE==5) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87066/CWE194_Unexpected_Sign_Extension__negative_malloc_13.c
CWE194_Unexpected_Sign_Extension__negative_malloc_13_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_13_bad(void) { long lVar1; short sStack_a; sStack_a = 0; if (GLOBAL_CONST_FIVE == 5) { sStack_a = -1; } if (sStack_a < 100) { lVar1 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar1,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar1 + (long)sStack_a + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,448
void CWE194_Unexpected_Sign_Extension__negative_malloc_13_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87066/CWE194_Unexpected_Sign_Extension__negative_malloc_13.c
CWE194_Unexpected_Sign_Extension__negative_malloc_13_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_13_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,449
void CWE194_Unexpected_Sign_Extension__negative_malloc_14_bad() { short data; /* Initialize data */ data = 0; if(globalFive==5) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87067/CWE194_Unexpected_Sign_Extension__negative_malloc_14.c
CWE194_Unexpected_Sign_Extension__negative_malloc_14_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_14_bad(void) { long lVar1; short sStack_a; sStack_a = 0; if (globalFive == 5) { sStack_a = -1; } if (sStack_a < 100) { lVar1 = func_0x00400b00((long)sStack_a); func_0x00400aa0(lVar1,0x41,(long)(sStack_a + -1)); *(undefined *)(lVar1 + (long)sStack_a + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,450
void CWE194_Unexpected_Sign_Extension__negative_malloc_14_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87067/CWE194_Unexpected_Sign_Extension__negative_malloc_14.c
CWE194_Unexpected_Sign_Extension__negative_malloc_14_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_14_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,451
void CWE194_Unexpected_Sign_Extension__negative_malloc_15_bad() { short data; /* Initialize data */ data = 0; switch(6) { case 6: /* FLAW: Use a negative number */ data = -1; break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87068/CWE194_Unexpected_Sign_Extension__negative_malloc_15.c
CWE194_Unexpected_Sign_Extension__negative_malloc_15_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_15_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,452
void CWE194_Unexpected_Sign_Extension__negative_malloc_15_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87068/CWE194_Unexpected_Sign_Extension__negative_malloc_15.c
CWE194_Unexpected_Sign_Extension__negative_malloc_15_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_15_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
48,453
void CWE194_Unexpected_Sign_Extension__negative_malloc_16_bad() { short data; /* Initialize data */ data = 0; while(1) { /* FLAW: Use a negative number */ data = -1; break; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87069/CWE194_Unexpected_Sign_Extension__negative_malloc_16.c
CWE194_Unexpected_Sign_Extension__negative_malloc_16_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_16_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,454
void CWE194_Unexpected_Sign_Extension__negative_malloc_16_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87069/CWE194_Unexpected_Sign_Extension__negative_malloc_16.c
CWE194_Unexpected_Sign_Extension__negative_malloc_16_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_16_good(void) { goodG2B(); return; }
['gcc']
48,455
void CWE194_Unexpected_Sign_Extension__negative_malloc_17_bad() { int i; short data; /* Initialize data */ data = 0; for(i = 0; i < 1; i++) { /* FLAW: Use a negative number */ data = -1; } /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87070/CWE194_Unexpected_Sign_Extension__negative_malloc_17.c
CWE194_Unexpected_Sign_Extension__negative_malloc_17_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_17_bad(void) { long lVar1; short sStack_e; int iStack_c; sStack_e = 0; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { sStack_e = -1; } if (sStack_e < 100) { lVar1 = func_0x00400b00((long)sStack_e); func_0x00400aa0(lVar1,0x41,(long)(sStack_e + -1)); *(undefined *)(lVar1 + (long)sStack_e + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,456
void CWE194_Unexpected_Sign_Extension__negative_malloc_17_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87070/CWE194_Unexpected_Sign_Extension__negative_malloc_17.c
CWE194_Unexpected_Sign_Extension__negative_malloc_17_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_17_good(void) { goodG2B(); return; }
['gcc']
48,457
void CWE194_Unexpected_Sign_Extension__negative_malloc_34_bad() { short data; CWE194_Unexpected_Sign_Extension__negative_malloc_34_unionType myUnion; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; myUnion.unionFirst = data; { short data = myUnion.unionSecond; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } } }
['/* Initialize data */', '/* FLAW: Use a negative number */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87077/CWE194_Unexpected_Sign_Extension__negative_malloc_34.c
CWE194_Unexpected_Sign_Extension__negative_malloc_34_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_34_bad(void) { long lVar1; lVar1 = func_0x00400b00(0xffffffffffffffff); func_0x00400aa0(lVar1,0x41,0xfffffffffffffffe); *(undefined *)(lVar1 + -2) = 0; printLine(lVar1); func_0x00400a60(lVar1); return; }
['gcc']
48,458
void CWE194_Unexpected_Sign_Extension__negative_malloc_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87077/CWE194_Unexpected_Sign_Extension__negative_malloc_34.c
CWE194_Unexpected_Sign_Extension__negative_malloc_34_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_34_good(void) { goodG2B(); return; }
['gcc']
48,459
void CWE194_Unexpected_Sign_Extension__negative_malloc_42_bad() { short data; /* Initialize data */ data = 0; data = badSource(data); /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87079/CWE194_Unexpected_Sign_Extension__negative_malloc_42.c
CWE194_Unexpected_Sign_Extension__negative_malloc_42_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_42_bad(void) { short sVar1; long lVar2; sVar1 = badSource(0); if (sVar1 < 100) { lVar2 = func_0x00400b00((long)sVar1); func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1)); *(undefined *)(lVar2 + (long)sVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,460
void CWE194_Unexpected_Sign_Extension__negative_malloc_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87079/CWE194_Unexpected_Sign_Extension__negative_malloc_42.c
CWE194_Unexpected_Sign_Extension__negative_malloc_42_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_42_good(void) { goodG2B(); return; }
['gcc']
48,461
void CWE194_Unexpected_Sign_Extension__negative_malloc_45_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_45_badData = data; badSink(); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87082/CWE194_Unexpected_Sign_Extension__negative_malloc_45.c
CWE194_Unexpected_Sign_Extension__negative_malloc_45_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_45_bad(void) { CWE194_Unexpected_Sign_Extension__negative_malloc_45_badData = 0xffff; badSink(); return; }
['gcc']
48,462
void CWE194_Unexpected_Sign_Extension__negative_malloc_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87082/CWE194_Unexpected_Sign_Extension__negative_malloc_45.c
CWE194_Unexpected_Sign_Extension__negative_malloc_45_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_45_good(void) { goodG2B(); return; }
['gcc']
48,463
void CWE194_Unexpected_Sign_Extension__negative_malloc_51_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_51b_badSink(data); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87083/CWE194_Unexpected_Sign_Extension__negative_malloc_51a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_51_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_51_bad(void) { CWE194_Unexpected_Sign_Extension__negative_malloc_51b_badSink(0xffffffff); return; }
['gcc']
48,464
void CWE194_Unexpected_Sign_Extension__negative_malloc_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87083/CWE194_Unexpected_Sign_Extension__negative_malloc_51a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_51_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_51_good(void) { goodG2B(); return; }
['gcc']
48,465
void CWE194_Unexpected_Sign_Extension__negative_malloc_51b_badSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87083/CWE194_Unexpected_Sign_Extension__negative_malloc_51b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_51b_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_51b_badSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,466
void CWE194_Unexpected_Sign_Extension__negative_malloc_51b_goodG2BSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87083/CWE194_Unexpected_Sign_Extension__negative_malloc_51b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_51b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_51b_goodG2BSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,467
void CWE194_Unexpected_Sign_Extension__negative_malloc_52_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_52b_badSink(data); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87084/CWE194_Unexpected_Sign_Extension__negative_malloc_52a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_52_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_52_bad(void) { CWE194_Unexpected_Sign_Extension__negative_malloc_52b_badSink(0xffffffff); return; }
['gcc']
48,468
void CWE194_Unexpected_Sign_Extension__negative_malloc_52_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87084/CWE194_Unexpected_Sign_Extension__negative_malloc_52a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_52_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_52_good(void) { goodG2B(); return; }
['gcc']
48,469
void CWE194_Unexpected_Sign_Extension__negative_malloc_52b_badSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_52c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87084/CWE194_Unexpected_Sign_Extension__negative_malloc_52b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_52b_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_52b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_52c_badSink((int)param_1); return; }
['gcc']
48,470
void CWE194_Unexpected_Sign_Extension__negative_malloc_52b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87084/CWE194_Unexpected_Sign_Extension__negative_malloc_52b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_52b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_52b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_52c_goodG2BSink((int)param_1); return; }
['gcc']
48,471
void CWE194_Unexpected_Sign_Extension__negative_malloc_52c_badSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87084/CWE194_Unexpected_Sign_Extension__negative_malloc_52c.c
CWE194_Unexpected_Sign_Extension__negative_malloc_52c_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_52c_badSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,472
void CWE194_Unexpected_Sign_Extension__negative_malloc_52c_goodG2BSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87084/CWE194_Unexpected_Sign_Extension__negative_malloc_52c.c
CWE194_Unexpected_Sign_Extension__negative_malloc_52c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_52c_goodG2BSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,473
void CWE194_Unexpected_Sign_Extension__negative_malloc_53_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_53b_badSink(data); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_53_bad(void) { CWE194_Unexpected_Sign_Extension__negative_malloc_53b_badSink(0xffffffff); return; }
['gcc']
48,474
void CWE194_Unexpected_Sign_Extension__negative_malloc_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_53_good(void) { goodG2B(); return; }
['gcc']
48,475
void CWE194_Unexpected_Sign_Extension__negative_malloc_53b_badSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_53c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53b_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_53b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_53c_badSink((int)param_1); return; }
['gcc']
48,476
void CWE194_Unexpected_Sign_Extension__negative_malloc_53b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_53b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_53c_goodG2BSink((int)param_1); return; }
['gcc']
48,477
void CWE194_Unexpected_Sign_Extension__negative_malloc_53c_badSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_53d_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53c.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53c_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_53c_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_53d_badSink((int)param_1); return; }
['gcc']
48,478
void CWE194_Unexpected_Sign_Extension__negative_malloc_53c_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53c.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_53c_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_53d_goodG2BSink((int)param_1); return; }
['gcc']
48,479
void CWE194_Unexpected_Sign_Extension__negative_malloc_53d_badSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53d.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53d_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_53d_badSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,480
void CWE194_Unexpected_Sign_Extension__negative_malloc_53d_goodG2BSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87085/CWE194_Unexpected_Sign_Extension__negative_malloc_53d.c
CWE194_Unexpected_Sign_Extension__negative_malloc_53d_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_53d_goodG2BSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,481
void CWE194_Unexpected_Sign_Extension__negative_malloc_54_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_54b_badSink(data); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_54_bad(void) { CWE194_Unexpected_Sign_Extension__negative_malloc_54b_badSink(0xffffffff); return; }
['gcc']
48,482
void CWE194_Unexpected_Sign_Extension__negative_malloc_54_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_54_good(void) { goodG2B(); return; }
['gcc']
48,483
void CWE194_Unexpected_Sign_Extension__negative_malloc_54b_badSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_54c_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54b_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54b_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_54c_badSink((int)param_1); return; }
['gcc']
48,484
void CWE194_Unexpected_Sign_Extension__negative_malloc_54b_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54b_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_54c_goodG2BSink((int)param_1); return; }
['gcc']
48,485
void CWE194_Unexpected_Sign_Extension__negative_malloc_54c_badSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_54d_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54c.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54c_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54c_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_54d_badSink((int)param_1); return; }
['gcc']
48,486
void CWE194_Unexpected_Sign_Extension__negative_malloc_54c_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54c.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54c_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54c_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_54d_goodG2BSink((int)param_1); return; }
['gcc']
48,487
void CWE194_Unexpected_Sign_Extension__negative_malloc_54d_badSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_54e_badSink(data); }
[]
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54d.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54d_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54d_badSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_54e_badSink((int)param_1); return; }
['gcc']
48,488
void CWE194_Unexpected_Sign_Extension__negative_malloc_54d_goodG2BSink(short data) { CWE194_Unexpected_Sign_Extension__negative_malloc_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54d.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54d_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54d_goodG2BSink(short param_1) { CWE194_Unexpected_Sign_Extension__negative_malloc_54e_goodG2BSink((int)param_1); return; }
['gcc']
48,489
void CWE194_Unexpected_Sign_Extension__negative_malloc_54e_badSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54e.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54e_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54e_badSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,490
void CWE194_Unexpected_Sign_Extension__negative_malloc_54e_goodG2BSink(short data) { /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87086/CWE194_Unexpected_Sign_Extension__negative_malloc_54e.c
CWE194_Unexpected_Sign_Extension__negative_malloc_54e_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_54e_goodG2BSink(short param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400b00((long)param_1); func_0x00400aa0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400a60(lVar1); } return; }
['gcc']
48,491
void CWE194_Unexpected_Sign_Extension__negative_malloc_61_bad() { short data; /* Initialize data */ data = 0; data = CWE194_Unexpected_Sign_Extension__negative_malloc_61b_badSource(data); /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Initialize data */', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87087/CWE194_Unexpected_Sign_Extension__negative_malloc_61a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_61_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_61_bad(void) { short sVar1; long lVar2; sVar1 = CWE194_Unexpected_Sign_Extension__negative_malloc_61b_badSource(0); if (sVar1 < 100) { lVar2 = func_0x00400b00((long)sVar1); func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1)); *(undefined *)(lVar2 + (long)sVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,492
void CWE194_Unexpected_Sign_Extension__negative_malloc_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87087/CWE194_Unexpected_Sign_Extension__negative_malloc_61a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_61_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_61_good(void) { goodG2B(); return; }
['gcc']
48,493
short CWE194_Unexpected_Sign_Extension__negative_malloc_61b_badSource(short data) { /* FLAW: Use a negative number */ data = -1; return data; }
['/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87087/CWE194_Unexpected_Sign_Extension__negative_malloc_61b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_61b_badSource
undefined2 CWE194_Unexpected_Sign_Extension__negative_malloc_61b_badSource(void) { return 0xffff; }
['gcc']
48,494
short CWE194_Unexpected_Sign_Extension__negative_malloc_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/87087/CWE194_Unexpected_Sign_Extension__negative_malloc_61b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_61b_goodG2BSource
undefined2 CWE194_Unexpected_Sign_Extension__negative_malloc_61b_goodG2BSource(void) { return 99; }
['gcc']
48,495
void CWE194_Unexpected_Sign_Extension__negative_malloc_63_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_63b_badSink(&data); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87089/CWE194_Unexpected_Sign_Extension__negative_malloc_63a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_63_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_63_bad(void) { undefined2 uStack_a; uStack_a = 0xffff; CWE194_Unexpected_Sign_Extension__negative_malloc_63b_badSink(&uStack_a); return; }
['gcc']
48,496
void CWE194_Unexpected_Sign_Extension__negative_malloc_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87089/CWE194_Unexpected_Sign_Extension__negative_malloc_63a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_63_good
void CWE194_Unexpected_Sign_Extension__negative_malloc_63_good(void) { goodG2B(); return; }
['gcc']
48,497
void CWE194_Unexpected_Sign_Extension__negative_malloc_63b_badSink(short * dataPtr) { short data = *dataPtr; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87089/CWE194_Unexpected_Sign_Extension__negative_malloc_63b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_63b_badSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_63b_badSink(short *param_1) { short sVar1; long lVar2; sVar1 = *param_1; if (sVar1 < 100) { lVar2 = func_0x00400b00((long)sVar1); func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1)); *(undefined *)(lVar2 + (long)sVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,498
void CWE194_Unexpected_Sign_Extension__negative_malloc_63b_goodG2BSink(short * dataPtr) { short data = *dataPtr; /* Assume we want to allocate a relatively small buffer */ if (data < 100) { /* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative, * the conversion will cause malloc() to allocate a very large amount of data or fail */ char * dataBuffer = (char *)malloc(data); /* Do something with dataBuffer */ memset(dataBuffer, 'A', data-1); dataBuffer[data-1] = '\0'; printLine(dataBuffer); free(dataBuffer); } }
['/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87089/CWE194_Unexpected_Sign_Extension__negative_malloc_63b.c
CWE194_Unexpected_Sign_Extension__negative_malloc_63b_goodG2BSink
void CWE194_Unexpected_Sign_Extension__negative_malloc_63b_goodG2BSink(short *param_1) { short sVar1; long lVar2; sVar1 = *param_1; if (sVar1 < 100) { lVar2 = func_0x00400b00((long)sVar1); func_0x00400aa0(lVar2,0x41,(long)(sVar1 + -1)); *(undefined *)(lVar2 + (long)sVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
48,499
void CWE194_Unexpected_Sign_Extension__negative_malloc_64_bad() { short data; /* Initialize data */ data = 0; /* FLAW: Use a negative number */ data = -1; CWE194_Unexpected_Sign_Extension__negative_malloc_64b_badSink(&data); }
['/* Initialize data */', '/* FLAW: Use a negative number */']
['CWE194']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87090/CWE194_Unexpected_Sign_Extension__negative_malloc_64a.c
CWE194_Unexpected_Sign_Extension__negative_malloc_64_bad
void CWE194_Unexpected_Sign_Extension__negative_malloc_64_bad(void) { undefined2 uStack_a; uStack_a = 0xffff; CWE194_Unexpected_Sign_Extension__negative_malloc_64b_badSink(&uStack_a); return; }
['gcc']