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
50,600
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_badSink(param_1); return; }
['gcc']
50,601
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54d_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_goodG2BSink(param_1); return; }
['gcc']
50,602
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_badSink(int 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 */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d40((long)param_1); func_0x00400cd0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c70(lVar1); } return; }
['gcc']
50,603
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_goodG2BSink(int 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/88046/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_54e_goodG2BSink(int 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']
50,604
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61_bad() { int data; /* Initialize data */ data = -1; data = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_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 */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88047/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61_bad(void) { int iVar1; long lVar2; iVar1 = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_badSource(0xffffffff) ; if (iVar1 < 100) { lVar2 = func_0x00400d40((long)iVar1); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,605
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88047/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61_good(void) { goodG2B(); return; }
['gcc']
50,606
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_badSource(int data) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } return data; }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88047/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_badSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_badSource(undefined4 param_1) { int iVar1; undefined4 uStack_3c; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; int iStack_c; iStack_10 = 0xffffffff; iStack_c = -1; iStack_10 = func_0x00400dd0(2,1,6); uStack_3c = param_1; if (iStack_10 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_10,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_10,5), iVar1 != -1)) && (iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) && ((iStack_14 = func_0x00400c80(iStack_c,auStack_36,0xd,0), iStack_14 != -1 && (iStack_14 != 0) ))) { auStack_36[iStack_14] = 0; uStack_3c = func_0x00400da0(auStack_36); } } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c != -1) { func_0x00400ce0(iStack_c); } return uStack_3c; }
['gcc']
50,607
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_goodG2BSource(int 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/88047/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_goodG2BSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_61b_goodG2BSource(void) { return 99; }
['gcc']
50,608
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_badSink(&data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88049/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; undefined4 uStack_18; int iStack_14; int iStack_10; int iStack_c; uStack_18 = 0xffffffff; iStack_10 = 0xffffffff; iStack_c = -1; iStack_10 = func_0x00400dd0(2,1,6); if (iStack_10 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_10,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_10,5), iVar1 != -1)) && (iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) && ((iStack_14 = func_0x00400c80(iStack_c,auStack_36,0xd,0), iStack_14 != -1 && (iStack_14 != 0) ))) { auStack_36[iStack_14] = 0; uStack_18 = func_0x00400da0(auStack_36); } } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } if (iStack_c != -1) { func_0x00400ce0(iStack_c); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_badSink(&uStack_18); return; }
['gcc']
50,609
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88049/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63_good(void) { goodG2B(); return; }
['gcc']
50,610
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_badSink(int * dataPtr) { int 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 */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88049/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_badSink(int *param_1) { int iVar1; long lVar2; iVar1 = *param_1; if (iVar1 < 100) { lVar2 = func_0x00400d40((long)iVar1); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,611
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_goodG2BSink(int * dataPtr) { int 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/88049/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_63b_goodG2BSink(int *param_1) { int iVar1; long lVar2; iVar1 = *param_1; if (iVar1 < 100) { lVar2 = func_0x00400b00((long)iVar1); func_0x00400aa0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
50,612
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66_bad() { int data; int dataArray[5]; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } 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; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_badSink(dataArray); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* put data in array */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88052/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66_bad(void) { int iVar1; undefined auStack_56 [14]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; undefined auStack_38 [8]; undefined4 uStack_30; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_56,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_56[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_56); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } uStack_30 = uStack_c; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_badSink(auStack_38); return; }
['gcc']
50,613
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88052/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66_good(void) { goodG2B(); return; }
['gcc']
50,614
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_badSink(int dataArray[]) { /* copy data out of dataArray */ int data = dataArray[2]; /* 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); } }
['/* copy data out of dataArray */', '/* 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 */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88052/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_badSink(long param_1) { int iVar1; long lVar2; iVar1 = *(int *)(param_1 + 8); if (iVar1 < 100) { lVar2 = func_0x00400d40((long)iVar1); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,615
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_goodG2BSink(int dataArray[]) { int data = dataArray[2]; /* 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/88052/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_66b_goodG2BSink(long param_1) { int iVar1; long lVar2; iVar1 = *(int *)(param_1 + 8); if (iVar1 < 100) { lVar2 = func_0x00400b00((long)iVar1); func_0x00400aa0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
50,616
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_bad() { int data; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_structType myStruct; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } 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; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_badSink(myStruct); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88053/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; undefined4 uStack_1c; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_46); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } uStack_1c = uStack_c; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_badSink(uStack_c); return; }
['gcc']
50,617
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88053/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_good(void) { goodG2B(); return; }
['gcc']
50,618
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_badSink(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_structType myStruct) { int data = myStruct.structFirst; /* 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 */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88053/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_badSink(int param_1) { long lVar1; if (param_1 < 100) { lVar1 = func_0x00400d40((long)param_1); func_0x00400cd0(lVar1,0x41,(long)(param_1 + -1)); *(undefined *)(lVar1 + (long)param_1 + -1) = 0; printLine(lVar1); func_0x00400c70(lVar1); } return; }
['gcc']
50,619
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_goodG2BSink(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67_structType myStruct) { int data = myStruct.structFirst; /* 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/88053/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_67b_goodG2BSink(int 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']
50,620
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_badData = data; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88054/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400dd0(2,1,6); if (iStack_14 != -1) { func_0x00400cd0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400cb0(0x6987); iVar1 = func_0x00400d80(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d70(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d90(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c80(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400da0(auStack_36); } } if (iStack_14 != -1) { func_0x00400ce0(iStack_14); } if (iStack_10 != -1) { func_0x00400ce0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_badData = uStack_c; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_badSink(); return; }
['gcc']
50,621
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88054/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_good(void) { goodG2B(); return; }
['gcc']
50,622
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_badSink() { int data = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_badData; /* 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 */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88054/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_badSink(void) { int iVar1; long lVar2; iVar1 = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_badData; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_badData < 100) { lVar2 = func_0x00400d40((long) CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_badData ); func_0x00400cd0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400c70(lVar2); } return; }
['gcc']
50,623
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_goodG2BSink() { int data = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_goodG2BData; /* 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/88054/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68b_goodG2BSink(void) { int iVar1; long lVar2; iVar1 = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_goodG2BData; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_goodG2BData < 100) { lVar2 = func_0x00400b00((long) CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_malloc_68_goodG2BData ); func_0x00400aa0(lVar2,0x41,(long)(iVar1 + -1)); *(undefined *)(lVar2 + (long)iVar1 + -1) = 0; printLine(lVar2); func_0x00400a60(lVar2); } return; }
['gcc']
50,624
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88062/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,625
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88062/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_01_good(void) { goodG2B(); return; }
['gcc']
50,626
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02_bad() { int data; /* Initialize data */ data = -1; if(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88063/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,627
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88063/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_02_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,628
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03_bad() { int data; /* Initialize data */ data = -1; if(5==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88064/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,629
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88064/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,630
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04_bad() { int data; /* Initialize data */ data = -1; if(STATIC_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88065/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,631
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88065/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,632
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_bad() { int data; /* Initialize data */ data = -1; if(staticTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88066/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (staticTrue != 0) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,633
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88066/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,634
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06_bad() { int data; /* Initialize data */ data = -1; if(STATIC_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88067/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,635
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88067/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_06_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,636
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07_bad() { int data; /* Initialize data */ data = -1; if(staticFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88068/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (staticFive == 5) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,637
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88068/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_07_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,638
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08_bad() { int data; /* Initialize data */ data = -1; if(staticReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88069/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,639
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88069/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_08_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,640
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09_bad() { int data; /* Initialize data */ data = -1; if(GLOBAL_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88070/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (GLOBAL_CONST_TRUE != 0) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,641
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88070/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_09_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,642
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10_bad() { int data; /* Initialize data */ data = -1; if(globalTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88071/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (globalTrue != 0) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,643
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88071/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_10_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,644
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11_bad() { int data; /* Initialize data */ data = -1; if(globalReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88072/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,645
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88072/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_11_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,646
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12_bad() { int data; /* Initialize data */ data = -1; if(globalReturnsTrueOrFalse()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } else { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* FIX: Use a positive integer less than &InitialDataSize&*/', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88073/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { iStack_c = 99; } else { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,647
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88073/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_12_good(void) { goodG2B(); return; }
['gcc']
50,648
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_bad() { int data; /* Initialize data */ data = -1; if(GLOBAL_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88074/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (GLOBAL_CONST_FIVE == 5) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,649
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88074/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_13_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,650
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14_bad() { int data; /* Initialize data */ data = -1; if(globalFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88075/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; if (globalFive == 5) { iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,651
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88075/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_14_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,652
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15_bad() { int data; /* Initialize data */ data = -1; switch(6) { case 6: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88076/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,653
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88076/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_15_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,654
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_bad() { int data; /* Initialize data */ data = -1; while(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88077/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,655
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88077/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_16_good(void) { goodG2B(); return; }
['gcc']
50,656
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17_bad() { int i; int data; /* Initialize data */ data = -1; for(i = 0; i < 1; i++) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88078/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17_bad(void) { int iVar1; undefined auStack_128 [99]; undefined uStack_c5; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_10 = -1; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { iStack_18 = 0xffffffff; iStack_14 = -1; iStack_18 = func_0x00400da0(2,1,6); if (iStack_18 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_18,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_18,5), iVar1 != -1)) && (iStack_14 = func_0x00400d60(iStack_18,0,0), iStack_14 != -1)) && ((iStack_1c = func_0x00400c50(iStack_14,auStack_46,0xd,0), iStack_1c != -1 && (iStack_1c != 0)))) { auStack_46[iStack_1c] = 0; iStack_10 = func_0x00400d70(auStack_46); } } if (iStack_18 != -1) { func_0x00400cb0(iStack_18); } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } } uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; func_0x00400ca0(auStack_128,0x41,99); uStack_c5 = 0; if (iStack_10 < 100) { func_0x00400d00(&uStack_b8,auStack_128,(long)iStack_10); *(undefined *)((long)&uStack_b8 + (long)iStack_10) = 0; } printLine(&uStack_b8); return; }
['gcc']
50,657
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88078/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_17_good(void) { goodG2B(); return; }
['gcc']
50,658
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18_bad() { int data; /* Initialize data */ data = -1; goto source; source: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88079/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18_bad(void) { int iVar1; undefined auStack_118 [99]; undefined uStack_b5; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; func_0x00400ca0(auStack_118,0x41,99); uStack_b5 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_a8,auStack_118,(long)iStack_c); *(undefined *)((long)&uStack_a8 + (long)iStack_c) = 0; } printLine(&uStack_a8); return; }
['gcc']
50,659
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88079/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_18_good(void) { goodG2B(); return; }
['gcc']
50,660
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21_bad() { int data; /* Initialize data */ data = -1; badStatic = 1; /* true */ data = badSource(data); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* true */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88080/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21_bad(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = 0xffffffff; badStatic = 1; iStack_c = badSource(0xffffffff); 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,661
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88080/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_21_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,662
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_bad() { int data; /* Initialize data */ data = -1; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badGlobal = 1; /* true */ data = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badSource(data); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* true */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88081/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_bad(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = 0xffffffff; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badGlobal = 1; iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badSource (0xffffffff); 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,663
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88081/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
50,664
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badSource(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badGlobal) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } return data; }
['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88081/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badSource
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badSource(undefined4 param_1) { int iVar1; undefined4 uStack_3c; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; int iStack_c; uStack_3c = param_1; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_badGlobal != 0) { iStack_10 = 0xffffffff; iStack_c = -1; iStack_10 = func_0x00400da0(2,1,6); if (iStack_10 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_10,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_10,5), iVar1 != -1)) && (iStack_c = func_0x00400d60(iStack_10,0,0), iStack_c != -1)) && ((iStack_14 = func_0x00400c50(iStack_c,auStack_36,0xd,0), iStack_14 != -1 && (iStack_14 != 0)))) { auStack_36[iStack_14] = 0; uStack_3c = func_0x00400d70(auStack_36); } } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } if (iStack_c != -1) { func_0x00400cb0(iStack_c); } } return uStack_3c; }
['gcc']
50,665
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B1Source(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Use a positive integer less than &InitialDataSize&*/ data = 100-1; } return data; }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* 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/88081/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B1Source
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B1Source (undefined4 param_1) { undefined4 uStack_c; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B1Global == 0) { uStack_c = 99; } else { printLine(&UNK_00401394); uStack_c = param_1; } return uStack_c; }
['gcc']
50,666
int CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B2Source(int data) { if(CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B2Global) { /* 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/88081/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B2Source
undefined4 CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B2Source (undefined4 param_1) { undefined4 uStack_c; uStack_c = param_1; if (CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_22_goodG2B2Global != 0) { uStack_c = 99; } return uStack_c; }
['gcc']
50,667
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { int dataCopy = data; int data = dataCopy; { 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88082/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31_bad(void) { int iVar1; undefined auStack_128 [99]; undefined uStack_c5; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_46); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } iStack_1c = iStack_c; iStack_20 = iStack_c; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; func_0x00400ca0(auStack_128,0x41,99); uStack_c5 = 0; if (iStack_20 < 100) { func_0x00400d00(&uStack_b8,auStack_128,(long)iStack_20); *(undefined *)((long)&uStack_b8 + (long)iStack_20) = 0; } printLine(&uStack_b8); return; }
['gcc']
50,668
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88082/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_31_good(void) { goodG2B(); return; }
['gcc']
50,669
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_bad() { int data; int *dataPtr1 = &data; int *dataPtr2 = &data; /* Initialize data */ data = -1; { int data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { int data = *dataPtr2; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88083/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_bad(void) { int iVar1; undefined auStack_138 [99]; undefined uStack_d5; undefined8 uStack_c8; undefined8 uStack_c0; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined4 uStack_68; undefined auStack_56 [14]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; int iStack_30; int iStack_2c; int iStack_28; int iStack_24; int *piStack_20; int *piStack_18; int iStack_10; int iStack_c; piStack_18 = &iStack_30; piStack_20 = &iStack_30; iStack_30 = -1; iStack_c = -1; iStack_24 = 0xffffffff; iStack_10 = -1; iStack_24 = func_0x00400da0(2,1,6); if (iStack_24 != -1) { func_0x00400ca0(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = 0; uStack_46 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_24,&uStack_48,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_24,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_24,0,0), iStack_10 != -1)) && ((iStack_28 = func_0x00400c50(iStack_10,auStack_56,0xd,0), iStack_28 != -1 && (iStack_28 != 0)))) { auStack_56[iStack_28] = 0; iStack_c = func_0x00400d70(auStack_56); } } if (iStack_24 != -1) { func_0x00400cb0(iStack_24); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } *piStack_18 = iStack_c; iStack_2c = *piStack_20; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; func_0x00400ca0(auStack_138,0x41,99); uStack_d5 = 0; if (iStack_2c < 100) { func_0x00400d00(&uStack_c8,auStack_138,(long)iStack_2c); *(undefined *)((long)&uStack_c8 + (long)iStack_2c) = 0; } printLine(&uStack_c8); return; }
['gcc']
50,670
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88083/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_32_good(void) { goodG2B(); return; }
['gcc']
50,671
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_bad() { int data; CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_unionType myUnion; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { int data = myUnion.unionSecond; { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } } }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88085/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_bad(void) { int iVar1; undefined auStack_128 [99]; undefined uStack_c5; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; int iStack_c; iStack_c = -1; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_46[iStack_18] = 0; iStack_c = func_0x00400d70(auStack_46); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } iStack_20 = iStack_c; iStack_1c = iStack_c; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; func_0x00400ca0(auStack_128,0x41,99); uStack_c5 = 0; if (iStack_1c < 100) { func_0x00400d00(&uStack_b8,auStack_128,(long)iStack_1c); *(undefined *)((long)&uStack_b8 + (long)iStack_1c) = 0; } printLine(&uStack_b8); return; }
['gcc']
50,672
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88085/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_34_good(void) { goodG2B(); return; }
['gcc']
50,673
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_badSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88086/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_badSink(int 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,674
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88086/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_badSink(uStack_c); return; }
['gcc']
50,675
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_goodG2BSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88086/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_goodG2BSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,676
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88086/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_41_good(void) { goodG2B(); return; }
['gcc']
50,677
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42_bad() { int data; /* Initialize data */ data = -1; data = badSource(data); { char source[100]; char dest[100] = ""; memset(source, 'A', 100-1); source[100-1] = '\0'; if (data < 100) { /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative, * the sign conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* Initialize data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88087/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42_bad(void) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; int iStack_c; iStack_c = 0xffffffff; iStack_c = badSource(0xffffffff); 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (iStack_c < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)iStack_c); *(undefined *)((long)&uStack_78 + (long)iStack_c) = 0; } printLine(&uStack_78); return; }
['gcc']
50,678
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88087/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_42_good(void) { goodG2B(); return; }
['gcc']
50,679
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44_bad() { int data; /* define a function pointer */ void (*funcPtr) (int) = badSink; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } 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 */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* use the function pointer */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88089/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44_bad(void) { int iVar1; undefined auStack_46 [14]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; int iStack_10; undefined4 uStack_c; pcStack_18 = badSink; uStack_c = 0xffffffff; iStack_1c = 0xffffffff; iStack_10 = -1; iStack_1c = func_0x00400da0(2,1,6); if (iStack_1c != -1) { func_0x00400ca0(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = 0; uStack_36 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_1c,&uStack_38,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_1c,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_1c,0,0), iStack_10 != -1)) && ((iStack_20 = func_0x00400c50(iStack_10,auStack_46,0xd,0), iStack_20 != -1 && (iStack_20 != 0)))) { auStack_46[iStack_20] = 0; uStack_c = func_0x00400d70(auStack_46); } } if (iStack_1c != -1) { func_0x00400cb0(iStack_1c); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } (*pcStack_18)(uStack_c); return; }
['gcc']
50,680
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88089/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_44_good(void) { goodG2B(); return; }
['gcc']
50,681
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_badData = data; badSink(); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88090/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_badData = uStack_c; badSink(); return; }
['gcc']
50,682
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88090/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_45_good(void) { goodG2B(); return; }
['gcc']
50,683
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88091/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_badSink(uStack_c); return; }
['gcc']
50,684
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88091/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51_good(void) { goodG2B(); return; }
['gcc']
50,685
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_badSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88091/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_badSink(int 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,686
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_goodG2BSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88091/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_51b_goodG2BSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,687
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88092/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_badSink(uStack_c); return; }
['gcc']
50,688
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88092/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52_good(void) { goodG2B(); return; }
['gcc']
50,689
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88092/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_badSink(param_1); return; }
['gcc']
50,690
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88092/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52b_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_goodG2BSink(param_1); return; }
['gcc']
50,691
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_badSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88092/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_badSink(int 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,692
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_goodG2BSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88092/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_52c_goodG2BSink(int param_1) { undefined auStack_e8 [99]; undefined uStack_85; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined8 uStack_28; undefined8 uStack_20; undefined4 uStack_18; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; uStack_20 = 0; uStack_18 = 0; func_0x00400a60(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400ab0(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']
50,693
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53_bad() { int data; /* Initialize data */ data = -1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; 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 /* POTENTIAL FLAW: Read data using a listen socket */ 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); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_badSink(data); }
['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53_bad
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53_bad(void) { int iVar1; undefined auStack_36 [14]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; undefined4 uStack_c; uStack_c = 0xffffffff; iStack_14 = 0xffffffff; iStack_10 = -1; iStack_14 = func_0x00400da0(2,1,6); if (iStack_14 != -1) { func_0x00400ca0(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = 0; uStack_26 = func_0x00400c80(0x6987); iVar1 = func_0x00400d50(iStack_14,&uStack_28,0x10); if ((((iVar1 != -1) && (iVar1 = func_0x00400d40(iStack_14,5), iVar1 != -1)) && (iStack_10 = func_0x00400d60(iStack_14,0,0), iStack_10 != -1)) && ((iStack_18 = func_0x00400c50(iStack_10,auStack_36,0xd,0), iStack_18 != -1 && (iStack_18 != 0)))) { auStack_36[iStack_18] = 0; uStack_c = func_0x00400d70(auStack_36); } } if (iStack_14 != -1) { func_0x00400cb0(iStack_14); } if (iStack_10 != -1) { func_0x00400cb0(iStack_10); } CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_badSink(uStack_c); return; }
['gcc']
50,694
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53a.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53_good
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53_good(void) { goodG2B(); return; }
['gcc']
50,695
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_badSink(param_1); return; }
['gcc']
50,696
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53b_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_goodG2BSink(param_1); return; }
['gcc']
50,697
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_badSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_badSink(data); }
[]
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_badSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_badSink(param_1); return; }
['gcc']
50,698
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_goodG2BSink(int data) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_goodG2BSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53c_goodG2BSink (undefined4 param_1) { CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_goodG2BSink(param_1); return; }
['gcc']
50,699
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_badSink(int 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 conversion could result in a very large number */ memcpy(dest, source, data); dest[data] = '\0'; /* NULL terminate */ } printLine(dest); } }
['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* NULL terminate */']
['CWE195']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/88093/CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d.c
CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_badSink
void CWE195_Signed_to_Unsigned_Conversion_Error__listen_socket_memcpy_53d_badSink(int 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_0x00400ca0(auStack_e8,0x41,99); uStack_85 = 0; if (param_1 < 100) { func_0x00400d00(&uStack_78,auStack_e8,(long)param_1); *(undefined *)((long)&uStack_78 + (long)param_1) = 0; } printLine(&uStack_78); return; }
['gcc']