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 |
|---|---|---|---|---|---|---|---|---|
49,600 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_21_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87600/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_21.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_21_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_21_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,601 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_bad()
{
int data;
/* Initialize data */
data = -1;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_badGlobal = 1; /* true */
data = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87601/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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__connect_socket_strncpy_22_badGlobal = 1;
iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,602 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87601/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,603 | int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_badSource(int data)
{
if(CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_badGlobal)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
return data;
} | ['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87601/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_badSource |
undefined4
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_10;
int iStack_c;
uStack_3c = param_1;
if (CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_badGlobal != 0) {
iStack_c = 0xffffffff;
iStack_c = func_0x00400d40(2,1,6);
if (iStack_c != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401574);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_c,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_10 = func_0x00400c00(iStack_c,auStack_36,0xd,0), iStack_10 != -1)) &&
(iStack_10 != 0)) {
auStack_36[iStack_10] = 0;
uStack_3c = func_0x00400d00(auStack_36);
}
}
if (iStack_c != -1) {
func_0x00400c70(iStack_c);
}
}
return uStack_3c;
}
| ['gcc'] |
49,604 | int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_goodG2B2Source(int data)
{
if(CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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/87601/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_goodG2B2Source |
undefined4
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_goodG2B2Source
(undefined4 param_1)
{
undefined4 uStack_c;
uStack_c = param_1;
if (CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_22_goodG2B2Global != 0) {
uStack_c = 99;
}
return uStack_c;
}
| ['gcc'] |
49,605 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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 */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87602/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_1c;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cb0(&UNK_00401564);
uStack_36 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_38,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_46[iStack_14] = 0;
iStack_c = func_0x00400d00(auStack_46);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
iStack_18 = 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_0x00400c60(auStack_128,0x41,99);
uStack_c5 = 0;
if (iStack_1c < 100) {
func_0x00400c10(&uStack_b8,auStack_128,(long)iStack_1c);
*(undefined *)((long)&uStack_b8 + (long)iStack_1c) = 0;
}
printLine(&uStack_b8);
return;
}
| ['gcc'] |
49,606 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87602/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_31_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,607 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 connectSocket = 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 connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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 */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87603/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_32.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_32_bad |
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_c;
piStack_18 = &iStack_30;
piStack_20 = &iStack_30;
iStack_30 = -1;
iStack_c = -1;
iStack_24 = 0xffffffff;
iStack_24 = func_0x00400d40(2,1,6);
if (iStack_24 != -1) {
func_0x00400c60(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400cb0(&UNK_00401594);
uStack_46 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_24,&uStack_48,0x10);
if (((iVar1 != -1) && (iStack_28 = func_0x00400c00(iStack_24,auStack_56,0xd,0), iStack_28 != -1)
) && (iStack_28 != 0)) {
auStack_56[iStack_28] = 0;
iStack_c = func_0x00400d00(auStack_56);
}
}
if (iStack_24 != -1) {
func_0x00400c70(iStack_24);
}
*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_0x00400c60(auStack_138,0x41,99);
uStack_d5 = 0;
if (iStack_2c < 100) {
func_0x00400c10(&uStack_c8,auStack_138,(long)iStack_2c);
*(undefined *)((long)&uStack_c8 + (long)iStack_2c) = 0;
}
printLine(&uStack_c8);
return;
}
| ['gcc'] |
49,608 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_32_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87603/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_32.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_32_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_32_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,609 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34_bad()
{
int data;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34_unionType myUnion;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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 */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87605/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_1c;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cb0(&UNK_00401564);
uStack_36 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_38,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_46[iStack_14] = 0;
iStack_c = func_0x00400d00(auStack_46);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
iStack_1c = iStack_c;
iStack_18 = 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_0x00400c60(auStack_128,0x41,99);
uStack_c5 = 0;
if (iStack_18 < 100) {
func_0x00400c10(&uStack_b8,auStack_128,(long)iStack_18);
*(undefined *)((long)&uStack_b8 + (long)iStack_18) = 0;
}
printLine(&uStack_b8);
return;
}
| ['gcc'] |
49,610 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87605/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_34_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,611 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87606/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,612 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87606/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_badSink(uStack_c);
return;
}
| ['gcc'] |
49,613 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87606/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,614 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87606/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_41_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,615 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87607/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_42.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_42_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,616 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_42_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87607/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_42.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_42_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_42_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,617 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 connectSocket = 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 connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87609/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_44.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_44_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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;
undefined4 uStack_c;
pcStack_18 = badSink;
uStack_c = 0xffffffff;
iStack_1c = 0xffffffff;
iStack_1c = func_0x00400d40(2,1,6);
if (iStack_1c != -1) {
func_0x00400c60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cb0(&UNK_00401574);
uStack_36 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_1c,&uStack_38,0x10);
if (((iVar1 != -1) && (iStack_20 = func_0x00400c00(iStack_1c,auStack_46,0xd,0), iStack_20 != -1)
) && (iStack_20 != 0)) {
auStack_46[iStack_20] = 0;
uStack_c = func_0x00400d00(auStack_46);
}
}
if (iStack_1c != -1) {
func_0x00400c70(iStack_1c);
}
(*pcStack_18)(uStack_c);
return;
}
| ['gcc'] |
49,618 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_44_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87609/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_44.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_44_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_44_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,619 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_badData = data;
badSink();
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87610/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_badData = uStack_c;
badSink();
return;
}
| ['gcc'] |
49,620 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87610/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_45_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,621 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87611/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51b_badSink(uStack_c);
return;
}
| ['gcc'] |
49,622 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87611/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,623 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87611/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_51b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,624 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87612/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401584);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_badSink(uStack_c);
return;
}
| ['gcc'] |
49,625 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87612/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,626 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_badSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c_badSink(data);
} | [] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87612/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_badSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c_badSink(param_1);
return;
}
| ['gcc'] |
49,627 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_goodG2BSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87612/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52b_goodG2BSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
49,628 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87612/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,629 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87612/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_52c_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,630 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401594);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_badSink(uStack_c);
return;
}
| ['gcc'] |
49,631 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,632 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_badSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_badSink(data);
} | [] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_badSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_badSink(param_1);
return;
}
| ['gcc'] |
49,633 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_goodG2BSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53b_goodG2BSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
49,634 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_badSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_badSink(data);
} | [] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_badSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_badSink(param_1);
return;
}
| ['gcc'] |
49,635 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_goodG2BSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53c_goodG2BSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_goodG2BSink(param_1);
return;
}
| ['gcc'] |
49,636 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,637 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87613/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_53d_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,638 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_004015b4);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_badSink(uStack_c);
return;
}
| ['gcc'] |
49,639 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,640 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_badSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_badSink(data);
} | [] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_badSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_badSink(param_1);
return;
}
| ['gcc'] |
49,641 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_goodG2BSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54b_goodG2BSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
49,642 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_badSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_badSink(data);
} | [] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_badSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_badSink(param_1);
return;
}
| ['gcc'] |
49,643 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_goodG2BSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54c_goodG2BSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_goodG2BSink(param_1);
return;
}
| ['gcc'] |
49,644 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_badSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_badSink(data);
} | [] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_badSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_badSink(param_1);
return;
}
| ['gcc'] |
49,645 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_goodG2BSink(int data)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54d_goodG2BSink
(undefined4 param_1)
{
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_goodG2BSink(param_1);
return;
}
| ['gcc'] |
49,646 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,647 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87614/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_54e_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,648 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61_bad()
{
int data;
/* Initialize data */
data = -1;
data = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b_badSource(data);
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always 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 */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87615/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61_bad(void)
{
undefined auStack_e8 [99];
undefined uStack_85;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
iStack_c = 0xffffffff;
iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,649 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87615/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,650 | int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b_badSource(int data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
} | ['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87615/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b_badSource |
undefined4
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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_10;
int iStack_c;
iStack_c = 0xffffffff;
iStack_c = func_0x00400d40(2,1,6);
uStack_3c = param_1;
if (iStack_c != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_c,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_10 = func_0x00400c00(iStack_c,auStack_36,0xd,0), iStack_10 != -1))
&& (iStack_10 != 0)) {
auStack_36[iStack_10] = 0;
uStack_3c = func_0x00400d00(auStack_36);
}
}
if (iStack_c != -1) {
func_0x00400c70(iStack_c);
}
return uStack_3c;
}
| ['gcc'] |
49,651 | int CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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/87615/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b_goodG2BSource |
undefined4
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_61b_goodG2BSource(void)
{
return 99;
}
| ['gcc'] |
49,652 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_badSink(&data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87617/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
undefined4 uStack_14;
int iStack_10;
int iStack_c;
uStack_14 = 0xffffffff;
iStack_c = 0xffffffff;
iStack_c = func_0x00400d40(2,1,6);
if (iStack_c != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_c,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_10 = func_0x00400c00(iStack_c,auStack_36,0xd,0), iStack_10 != -1))
&& (iStack_10 != 0)) {
auStack_36[iStack_10] = 0;
uStack_14 = func_0x00400d00(auStack_36);
}
}
if (iStack_c != -1) {
func_0x00400c70(iStack_c);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_badSink(&uStack_14);
return;
}
| ['gcc'] |
49,653 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87617/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,654 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_badSink(int * dataPtr)
{
int data = *dataPtr;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87617/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_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;
int iStack_c;
iStack_c = *param_1;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,655 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_goodG2BSink(int * dataPtr)
{
int data = *dataPtr;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87617/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_63b_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;
int iStack_c;
iStack_c = *param_1;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400a60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,656 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_badSink(&data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87618/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
undefined4 uStack_14;
int iStack_10;
int iStack_c;
uStack_14 = 0xffffffff;
iStack_c = 0xffffffff;
iStack_c = func_0x00400d40(2,1,6);
if (iStack_c != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401574);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_c,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_10 = func_0x00400c00(iStack_c,auStack_36,0xd,0), iStack_10 != -1))
&& (iStack_10 != 0)) {
auStack_36[iStack_10] = 0;
uStack_14 = func_0x00400d00(auStack_36);
}
}
if (iStack_c != -1) {
func_0x00400c70(iStack_c);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_badSink(&uStack_14);
return;
}
| ['gcc'] |
49,657 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87618/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,658 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
int * dataPtr = (int *)dataVoidPtr;
/* dereference dataPtr into data */
int data = (*dataPtr);
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87618/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_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;
int iStack_14;
int *piStack_10;
iStack_14 = *param_1;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
piStack_10 = param_1;
func_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_14 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_14);
*(undefined *)((long)&uStack_78 + (long)iStack_14) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,659 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_goodG2BSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
int * dataPtr = (int *)dataVoidPtr;
/* dereference dataPtr into data */
int data = (*dataPtr);
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87618/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_64b_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;
int iStack_14;
int *piStack_10;
iStack_14 = *param_1;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
piStack_10 = param_1;
func_0x00400a60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_14 < 100) {
func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_14);
*(undefined *)((long)&uStack_78 + (long)iStack_14) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,660 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65_bad()
{
int data;
/* define a function pointer */
void (*funcPtr) (int) = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_badSink;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87619/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65_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;
undefined4 uStack_c;
pcStack_18 = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_badSink;
uStack_c = 0xffffffff;
iStack_1c = 0xffffffff;
iStack_1c = func_0x00400d40(2,1,6);
if (iStack_1c != -1) {
func_0x00400c60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cb0(&UNK_00401574);
uStack_36 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_1c,&uStack_38,0x10);
if (((iVar1 != -1) && (iStack_20 = func_0x00400c00(iStack_1c,auStack_46,0xd,0), iStack_20 != -1)
) && (iStack_20 != 0)) {
auStack_46[iStack_20] = 0;
uStack_c = func_0x00400d00(auStack_46);
}
}
if (iStack_1c != -1) {
func_0x00400c70(iStack_1c);
}
(*pcStack_18)(uStack_c);
return;
}
| ['gcc'] |
49,661 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87619/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,662 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87619/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (param_1 < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,663 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_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 */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87619/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_65b_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_0x00400a20(&uStack_78,auStack_e8,(long)param_1);
*(undefined *)((long)&uStack_78 + (long)param_1) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,664 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_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 connectSocket = 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 connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* put data in array */
dataArray[2] = data;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_badSink(dataArray);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* 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/87620/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66_bad(void)
{
int iVar1;
undefined auStack_46 [14];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined auStack_28 [8];
undefined4 uStack_20;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400cb0(&UNK_00401574);
uStack_36 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_38,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_46[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_46);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
uStack_20 = uStack_c;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_badSink(auStack_28);
return;
}
| ['gcc'] |
49,665 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87620/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,666 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_badSink(int dataArray[])
{
/* copy data out of dataArray */
int data = dataArray[2];
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* copy data out of dataArray */', '/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87620/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_badSink(long param_1)
{
undefined auStack_e8 [99];
undefined uStack_85;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
iStack_c = *(int *)(param_1 + 8);
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_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,667 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_goodG2BSink(int dataArray[])
{
int data = dataArray[2];
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87620/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_66b_goodG2BSink
(long param_1)
{
undefined auStack_e8 [99];
undefined uStack_85;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
iStack_c = *(int *)(param_1 + 8);
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 (iStack_c < 100) {
func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,668 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_bad()
{
int data;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_structType myStruct;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myStruct.structFirst = data;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_badSink(myStruct);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87621/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_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;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
uStack_18 = uStack_c;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_badSink(uStack_c);
return;
}
| ['gcc'] |
49,669 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87621/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,670 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_badSink(CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_structType myStruct)
{
int data = myStruct.structFirst;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87621/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_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;
int iStack_c;
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;
iStack_c = param_1;
func_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,671 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_goodG2BSink(CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67_structType myStruct)
{
int data = myStruct.structFirst;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87621/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_67b_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;
int iStack_c;
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;
iStack_c = param_1;
func_0x00400a60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,672 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_badData = data;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_badSink();
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87622/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_10 = 0xffffffff;
iStack_10 = func_0x00400d40(2,1,6);
if (iStack_10 != -1) {
func_0x00400c60(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400cb0(&UNK_00401564);
uStack_26 = func_0x00400c40(0x6987);
iVar1 = func_0x00400d10(iStack_10,&uStack_28,0x10);
if (((iVar1 != -1) && (iStack_14 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_14 != -1)
) && (iStack_14 != 0)) {
auStack_36[iStack_14] = 0;
uStack_c = func_0x00400d00(auStack_36);
}
}
if (iStack_10 != -1) {
func_0x00400c70(iStack_10);
}
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_badData = uStack_c;
CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_badSink();
return;
}
| ['gcc'] |
49,673 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87622/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68a.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,674 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_badSink()
{
int data = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_badData;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87622/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_badSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_badSink(void)
{
undefined auStack_e8 [99];
undefined uStack_85;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_badData;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400c60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400c10(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,675 | void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_goodG2BSink()
{
int data = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_goodG2BData;
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
strncpy(dest, source, data);
dest[data] = '\0'; /* strncpy() does not always NULL terminate */
}
printLine(dest);
}
} | ['/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign conversion could result in a very large number */', '/* strncpy() does not always NULL terminate */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87622/CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b.c | CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_goodG2BSink |
void CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68b_goodG2BSink(void)
{
undefined auStack_e8 [99];
undefined uStack_85;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined8 uStack_40;
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined4 uStack_18;
int iStack_c;
iStack_c = CWE195_Signed_to_Unsigned_Conversion_Error__connect_socket_strncpy_68_goodG2BData;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
uStack_40 = 0;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
func_0x00400a60(auStack_e8,0x41,99);
uStack_85 = 0;
if (iStack_c < 100) {
func_0x00400a20(&uStack_78,auStack_e8,(long)iStack_c);
*(undefined *)((long)&uStack_78 + (long)iStack_c) = 0;
}
printLine(&uStack_78);
return;
}
| ['gcc'] |
49,676 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01_bad()
{
int data;
/* Initialize data */
data = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87630/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,677 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87630/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_01_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
49,678 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02_bad()
{
int data;
/* Initialize data */
data = -1;
if(1)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87631/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,679 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87631/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_02_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,680 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03_bad()
{
int data;
/* Initialize data */
data = -1;
if(5==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87632/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401354);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,681 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87632/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_03_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,682 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04_bad()
{
int data;
/* Initialize data */
data = -1;
if(STATIC_CONST_TRUE)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87633/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_0040136c);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,683 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87633/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_04_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,684 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05_bad()
{
int data;
/* Initialize data */
data = -1;
if(staticTrue)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87634/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
if (staticTrue != 0) {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401364);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,685 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87634/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_05_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,686 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06_bad()
{
int data;
/* Initialize data */
data = -1;
if(STATIC_CONST_FIVE==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87635/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401368);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,687 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87635/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_06_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,688 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07_bad()
{
int data;
/* Initialize data */
data = -1;
if(staticFive==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87636/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
if (staticFive == 5) {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401364);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,689 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87636/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_07_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,690 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08_bad()
{
int data;
/* Initialize data */
data = -1;
if(staticReturnsTrue())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87637/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar2 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,691 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87637/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_08_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,692 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09_bad()
{
int data;
/* Initialize data */
data = -1;
if(GLOBAL_CONST_TRUE)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87638/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
if (GLOBAL_CONST_TRUE != 0) {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401364);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,693 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87638/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_09_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,694 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalTrue)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87639/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10_bad(void)
{
long lVar1;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
if (globalTrue != 0) {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar1 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401364);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,695 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87639/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_10_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,696 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalReturnsTrue())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
/* 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 */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* 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/87640/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar2 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401364);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,697 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87640/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_11_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
49,698 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalReturnsTrueOrFalse())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read data from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
data = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
else
{
/* FIX: Use a positive integer less than &InitialDataSize&*/
data = 100-1;
}
/* Assume we want to allocate a relatively small buffer */
if (data < 100)
{
/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,
* the conversion will cause malloc() to allocate a very large amount of data or fail */
char * dataBuffer = (char *)malloc(data);
/* Do something with dataBuffer */
memset(dataBuffer, 'A', data-1);
dataBuffer[data-1] = '\0';
printLine(dataBuffer);
free(dataBuffer);
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */', '/* FIX: Use a positive integer less than &InitialDataSize&*/', '/* Assume we want to allocate a relatively small buffer */', '/* POTENTIAL FLAW: malloc() takes a size_t (unsigned int) as input and therefore if it is negative,\r\n * the conversion will cause malloc() to allocate a very large amount of data or fail */', '/* Do something with dataBuffer */'] | ['CWE195'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87641/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12_bad |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_26;
undefined4 uStack_1e;
undefined2 uStack_1a;
long lStack_18;
int iStack_c;
iStack_c = -1;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
iStack_c = 99;
}
else {
uStack_26 = 0;
uStack_1e = 0;
uStack_1a = 0;
lVar2 = func_0x00400bb0(&uStack_26,0xe,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
}
else {
iStack_c = func_0x00400c20(&uStack_26);
}
}
if (iStack_c < 100) {
lStack_18 = func_0x00400bf0((long)iStack_c);
func_0x00400b80(lStack_18,0x41,(long)(iStack_c + -1));
*(undefined *)(lStack_18 + (long)iStack_c + -1) = 0;
printLine(lStack_18);
func_0x00400b40(lStack_18);
}
return;
}
| ['gcc'] |
49,699 | void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/87641/CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12.c | CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12_good |
void CWE195_Signed_to_Unsigned_Conversion_Error__fgets_malloc_12_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.