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 |
|---|---|---|---|---|---|---|---|---|
15,300 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b_goodG2BSink(int dataArray[])
{
int data = dataArray[2];
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62602/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b_goodG2BSink(long param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_10;
int iStack_c;
iStack_10 = *(int *)(param_1 + 8);
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (iStack_10 < 0) {
printLine(&UNK_00401358);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)iStack_10 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,301 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b_goodB2GSink(int dataArray[])
{
int data = dataArray[2];
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
} | ['/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62602/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_66b_goodB2GSink(long param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_10;
int iStack_c;
iStack_10 = *(int *)(param_1 + 8);
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((iStack_10 < 0) || (9 < iStack_10)) {
printLine(&UNK_00401378);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)iStack_10 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,302 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_bad()
{
int data;
CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_structType myStruct;
/* 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.");
}
}
myStruct.structFirst = data;
CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_badSink(myStruct);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data from the console using fgets() */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62603/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_bad(void)
{
long lVar1;
undefined8 uStack_1e;
undefined4 uStack_16;
undefined2 uStack_12;
undefined4 uStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1e = 0;
uStack_16 = 0;
uStack_12 = 0;
lVar1 = func_0x00400ab0(&uStack_1e,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401284);
}
else {
uStack_c = func_0x00400b10(&uStack_1e);
}
uStack_10 = uStack_c;
CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_badSink(uStack_c);
return;
}
| ['gcc'] |
15,303 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62603/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,304 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_badSink(CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_structType myStruct)
{
int data = myStruct.structFirst;
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62603/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_badSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_10;
int iStack_c;
iStack_10 = param_1;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401288);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,305 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_goodG2BSink(CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_structType myStruct)
{
int data = myStruct.structFirst;
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62603/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_goodG2BSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_10;
int iStack_c;
iStack_10 = param_1;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401348);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,306 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_goodB2GSink(CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67_structType myStruct)
{
int data = myStruct.structFirst;
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
} | ['/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62603/CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_fgets_67b_goodB2GSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_10;
int iStack_c;
iStack_10 = param_1;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((param_1 < 0) || (9 < param_1)) {
printLine(&UNK_00401368);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,307 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62708/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401538);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,308 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62708/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_01_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,309 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_bad()
{
int data;
/* Initialize data */
data = -1;
if(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(1)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62709/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401538);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,310 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62709/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_02_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,311 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03_bad()
{
int data;
/* Initialize data */
data = -1;
if(5==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(5==5)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62710/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401538);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,312 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62710/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_03_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,313 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04_bad()
{
int data;
/* Initialize data */
data = -1;
if(STATIC_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(STATIC_CONST_TRUE)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62711/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401550);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,314 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62711/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_04_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,315 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05_bad()
{
int data;
/* Initialize data */
data = -1;
if(staticTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(staticTrue)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62712/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
if (staticTrue != 0) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
if (staticTrue != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,316 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62712/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_05_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,317 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06_bad()
{
int data;
/* Initialize data */
data = -1;
if(STATIC_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(STATIC_CONST_FIVE==5)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62713/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401560);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,318 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62713/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,319 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07_bad()
{
int data;
/* Initialize data */
data = -1;
if(staticFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(staticFive==5)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62714/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
if (staticFive == 5) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
if (staticFive == 5) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,320 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62714/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,321 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08_bad()
{
int data;
/* Initialize data */
data = -1;
if(staticReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(staticReturnsTrue())
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62715/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_18,0,0), iStack_10 != -1)) &&
((iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401568);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,322 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62715/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,323 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09_bad()
{
int data;
/* Initialize data */
data = -1;
if(GLOBAL_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(GLOBAL_CONST_TRUE)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62716/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
if (GLOBAL_CONST_TRUE != 0) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
if (GLOBAL_CONST_TRUE != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,324 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62716/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,325 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(globalTrue)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62717/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
if (globalTrue != 0) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
if (globalTrue != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,326 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62717/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,327 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(globalReturnsTrue())
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62718/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_18,0,0), iStack_10 != -1)) &&
((iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_1c != -1 &&
(iStack_1c != 0)))) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,328 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62718/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_11_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,329 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalReturnsTrueOrFalse())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
else
{
/* FIX: Use a value greater than 0, but less than 10 to avoid attempting to
* access an index of the array in the sink that is out-of-bounds */
data = 7;
}
if(globalReturnsTrueOrFalse())
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
else
{
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* FIX: Use a value greater than 0, but less than 10 to avoid attempting to\r\n * access an index of the array in the sink that is out-of-bounds */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */', '/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62719/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined auStack_46 [14];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_20;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
iStack_c = 7;
}
else {
iStack_1c = 0xffffffff;
iStack_10 = -1;
iStack_1c = func_0x00400d40(2,1,6);
if (iStack_1c != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_1c,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_1c,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_1c,0,0), iStack_10 != -1)) &&
((iStack_20 = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_20 != -1 &&
(iStack_20 != 0)))) {
auStack_46[iStack_20] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
if (iStack_1c != -1) {
func_0x00400c60(iStack_1c);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if ((iStack_c < 0) || (9 < iStack_c)) {
printLine(&UNK_004015f8);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_18 = 0; iStack_18 < 10; iStack_18 = iStack_18 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_18 * 4));
}
}
}
else {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_004015d8);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,330 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62719/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_12_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,331 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13_bad()
{
int data;
/* Initialize data */
data = -1;
if(GLOBAL_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(GLOBAL_CONST_FIVE==5)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62720/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
if (GLOBAL_CONST_FIVE == 5) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
if (GLOBAL_CONST_FIVE == 5) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,332 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62720/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_13_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,333 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14_bad()
{
int data;
/* Initialize data */
data = -1;
if(globalFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
if(globalFive==5)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62721/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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;
if (globalFive == 5) {
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
}
if (globalFive == 5) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
}
return;
}
| ['gcc'] |
15,334 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62721/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_14_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,335 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15_bad()
{
int data;
/* Initialize data */
data = -1;
switch(6)
{
case 6:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
switch(7)
{
case 7:
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62722/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401538);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,336 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62722/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_15_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,337 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16_bad()
{
int data;
/* Initialize data */
data = -1;
while(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
break;
}
while(1)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
break;
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62723/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401538);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,338 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62723/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_16_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,339 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17_bad()
{
int i,j;
int data;
/* Initialize data */
data = -1;
for(i = 0; i < 1; i++)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
for(j = 0; j < 1; j++)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62724/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined auStack_46 [14];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_24;
int iStack_20;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_14 = -1;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
iStack_20 = 0xffffffff;
iStack_18 = -1;
iStack_20 = func_0x00400d40(2,1,6);
if (iStack_20 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_20,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_20,5), iVar1 != -1)) {
iStack_18 = func_0x00400d00(iStack_20,0,0);
if (iStack_18 != -1) {
iStack_24 = func_0x00400c00(iStack_18,auStack_46,0xd,0);
if ((iStack_24 != -1) && (iStack_24 != 0)) {
auStack_46[iStack_24] = 0;
iStack_14 = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_20 != -1) {
func_0x00400c60(iStack_20);
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
}
for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) {
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_14 < 0) {
printLine(&UNK_00401568);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4) = 1;
for (iStack_1c = 0; iStack_1c < 10; iStack_1c = iStack_1c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_1c * 4));
}
}
}
return;
}
| ['gcc'] |
15,340 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62724/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_17_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,341 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18_bad()
{
int data;
/* Initialize data */
data = -1;
goto source;
source:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
goto sink;
sink:
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62725/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 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_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401538);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,342 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62725/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_18_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,343 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
badStatic = 1; /* true */
badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* true */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62726/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
badStatic = 1;
badSink(uStack_c);
return;
}
| ['gcc'] |
15,344 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21_good()
{
goodB2G1();
goodB2G2();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62726/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_21_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
| ['gcc'] |
15,345 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badGlobal = 1; /* true */
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* true */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62727/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badGlobal = 1;
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badSink(uStack_c);
return;
}
| ['gcc'] |
15,346 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_good()
{
goodB2G1();
goodB2G2();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62727/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
| ['gcc'] |
15,347 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badSink(int data)
{
if(CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badGlobal)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62727/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
if (CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_badGlobal != 0) {
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401568);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
}
return;
}
| ['gcc'] |
15,348 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G1Sink(int data)
{
if(CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62727/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G1Sink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G1Sink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
if (CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G1Global == 0) {
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((param_1 < 0) || (9 < param_1)) {
printLine(&UNK_00401830);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
}
else {
printLine(&UNK_00401818);
}
return;
}
| ['gcc'] |
15,349 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G2Sink(int data)
{
if(CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G2Global)
{
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
}
} | ['/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62727/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G2Sink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G2Sink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
if (CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodB2G2Global != 0) {
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((param_1 < 0) || (9 < param_1)) {
printLine(&UNK_00401830);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
}
return;
}
| ['gcc'] |
15,350 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodG2BSink(int data)
{
if(CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodG2BGlobal)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62727/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodG2BSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
if (CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_22_goodG2BGlobal != 0) {
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401858);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
}
return;
}
| ['gcc'] |
15,351 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
int dataCopy = data;
int data = dataCopy;
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62728/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined auStack_46 [14];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_24;
int iStack_20;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
iStack_20 = iStack_c;
iStack_24 = iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401548);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,352 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62728/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_31_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,353 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32_bad()
{
int data;
int *dataPtr1 = &data;
int *dataPtr2 = &data;
/* Initialize data */
data = -1;
{
int data = *dataPtr1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
*dataPtr1 = data;
}
{
int data = *dataPtr2;
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62729/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32_bad |
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32_bad(void)
{
int iVar1;
undefined8 uStack_88;
undefined8 uStack_80;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined auStack_56 [14];
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
int iStack_38;
int iStack_34;
int iStack_30;
int iStack_2c;
int *piStack_28;
int *piStack_20;
int iStack_14;
int iStack_10;
int iStack_c;
piStack_20 = &iStack_38;
piStack_28 = &iStack_38;
iStack_38 = -1;
iStack_c = -1;
iStack_2c = 0xffffffff;
iStack_10 = -1;
iStack_2c = func_0x00400d40(2,1,6);
if (iStack_2c != -1) {
func_0x00400c50(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = 0;
uStack_46 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_2c,&uStack_48,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_2c,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_2c,0,0);
if (iStack_10 != -1) {
iStack_30 = func_0x00400c00(iStack_10,auStack_56,0xd,0);
if ((iStack_30 != -1) && (iStack_30 != 0)) {
auStack_56[iStack_30] = 0;
iStack_c = func_0x00400d10(auStack_56);
}
}
}
}
if (iStack_2c != -1) {
func_0x00400c60(iStack_2c);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
*piStack_20 = iStack_c;
iStack_34 = *piStack_28;
uStack_88 = 0;
uStack_80 = 0;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
if (iStack_34 < 0) {
printLine(&UNK_00401568);
}
else {
*(undefined4 *)((long)&uStack_88 + (long)iStack_34 * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_88 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,354 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62729/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_32_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,355 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_bad()
{
int data;
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_unionType myUnion;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myUnion.unionFirst = data;
{
int data = myUnion.unionSecond;
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62731/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_bad(void)
{
int iVar1;
undefined8 uStack_78;
undefined8 uStack_70;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined auStack_46 [14];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_24;
int iStack_20;
int iStack_1c;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_18 = 0xffffffff;
iStack_10 = -1;
iStack_18 = func_0x00400d40(2,1,6);
if (iStack_18 != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_18,&uStack_38,0x10);
if ((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_18,5), iVar1 != -1)) {
iStack_10 = func_0x00400d00(iStack_18,0,0);
if (iStack_10 != -1) {
iStack_1c = func_0x00400c00(iStack_10,auStack_46,0xd,0);
if ((iStack_1c != -1) && (iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400d10(auStack_46);
}
}
}
}
if (iStack_18 != -1) {
func_0x00400c60(iStack_18);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
iStack_24 = iStack_c;
iStack_20 = iStack_c;
uStack_78 = 0;
uStack_70 = 0;
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
if (iStack_c < 0) {
printLine(&UNK_00401548);
}
else {
*(undefined4 *)((long)&uStack_78 + (long)iStack_c * 4) = 1;
for (iStack_14 = 0; iStack_14 < 10; iStack_14 = iStack_14 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_14 * 4));
}
}
return;
}
| ['gcc'] |
15,356 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62731/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_34_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,357 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62732/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
badSink(uStack_c);
return;
}
| ['gcc'] |
15,358 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62732/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_41_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,359 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42_bad()
{
int data;
/* Initialize data */
data = -1;
data = badSource(data);
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62733/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42_bad(void)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_10;
int iStack_c;
iStack_10 = 0xffffffff;
iStack_10 = badSource(0xffffffff);
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (iStack_10 < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)iStack_10 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,360 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62733/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_42_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,361 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44_bad()
{
int data;
/* define a function pointer */
void (*funcPtr) (int) = badSink;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */', '/* use the function pointer */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62735/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44_bad(void)
{
int iVar1;
undefined auStack_46 [14];
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
int iStack_20;
int iStack_1c;
code *pcStack_18;
int iStack_10;
undefined4 uStack_c;
pcStack_18 = badSink;
uStack_c = 0xffffffff;
iStack_1c = 0xffffffff;
iStack_10 = -1;
iStack_1c = func_0x00400d40(2,1,6);
if (iStack_1c != -1) {
func_0x00400c50(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_1c,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_1c,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_1c,0,0), iStack_10 != -1)) &&
((iStack_20 = func_0x00400c00(iStack_10,auStack_46,0xd,0), iStack_20 != -1 &&
(iStack_20 != 0)))) {
auStack_46[iStack_20] = 0;
uStack_c = func_0x00400d10(auStack_46);
}
}
if (iStack_1c != -1) {
func_0x00400c60(iStack_1c);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
(*pcStack_18)(uStack_c);
return;
}
| ['gcc'] |
15,362 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62735/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_44_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,363 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_badData = data;
badSink();
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62736/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_badData = uStack_c;
badSink();
return;
}
| ['gcc'] |
15,364 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62736/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_45_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,365 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62737/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_badSink(uStack_c);
return;
}
| ['gcc'] |
15,366 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62737/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,367 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_badSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62737/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_badSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401558);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,368 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_goodG2BSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62737/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_goodG2BSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401608);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,369 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_goodB2GSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
} | ['/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62737/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_51b_goodB2GSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((param_1 < 0) || (9 < param_1)) {
printLine(&UNK_00401628);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,370 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_badSink(uStack_c);
return;
}
| ['gcc'] |
15,371 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,372 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_badSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_badSink(data);
} | [] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_badSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_badSink(param_1);
return;
}
| ['gcc'] |
15,373 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_goodG2BSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_goodG2BSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
15,374 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_goodB2GSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52b_goodB2GSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
15,375 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_badSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_badSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401568);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,376 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodG2BSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodG2BSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401638);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,377 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodB2GSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
} | ['/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62738/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_52c_goodB2GSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((param_1 < 0) || (9 < param_1)) {
printLine(&UNK_00401658);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,378 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_badSink(uStack_c);
return;
}
| ['gcc'] |
15,379 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,380 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_badSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_badSink(data);
} | [] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_badSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_badSink(param_1);
return;
}
| ['gcc'] |
15,381 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_goodG2BSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_goodG2BSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
15,382 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_goodB2GSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53b_goodB2GSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
15,383 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_badSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_badSink(data);
} | [] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_badSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_badSink(param_1);
return;
}
| ['gcc'] |
15,384 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodG2BSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodG2BSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodG2BSink(param_1);
return;
}
| ['gcc'] |
15,385 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodB2GSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53c_goodB2GSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
15,386 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_badSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_badSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401588);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,387 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodG2BSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound
* This code does check to see if the array index is negative */
if (data >= 0)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
} | ['/* POTENTIAL FLAW: Attempt to write to an index of the array that is above the upper bound\r\n * This code does check to see if the array index is negative */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodG2BSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if (param_1 < 0) {
printLine(&UNK_00401668);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,388 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodB2GSink(int data)
{
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer overflow */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
} | ['/* FIX: Properly validate the array index and prevent a buffer overflow */', '/* Print the array values */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62739/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_53d_goodB2GSink(int param_1)
{
undefined8 uStack_38;
undefined8 uStack_30;
undefined8 uStack_28;
undefined8 uStack_20;
undefined8 uStack_18;
int iStack_c;
uStack_38 = 0;
uStack_30 = 0;
uStack_28 = 0;
uStack_20 = 0;
uStack_18 = 0;
if ((param_1 < 0) || (9 < param_1)) {
printLine(&UNK_00401688);
}
else {
*(undefined4 *)((long)&uStack_38 + (long)param_1 * 4) = 1;
for (iStack_c = 0; iStack_c < 10; iStack_c = iStack_c + 1) {
printIntLine(*(undefined4 *)((long)&uStack_38 + (long)iStack_c * 4));
}
}
return;
}
| ['gcc'] |
15,389 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_badSink(data);
} | ['/* Initialize data */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* NUL-terminate the string */', '/* Convert to int */'] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54_bad(void)
{
int iVar1;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
iStack_14 = 0xffffffff;
iStack_10 = -1;
iStack_14 = func_0x00400d40(2,1,6);
if (iStack_14 != -1) {
func_0x00400c50(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = 0;
uStack_26 = func_0x00400c30(0x6987);
iVar1 = func_0x00400cf0(iStack_14,&uStack_28,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400ce0(iStack_14,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400d00(iStack_14,0,0), iStack_10 != -1)) &&
((iStack_18 = func_0x00400c00(iStack_10,auStack_36,0xd,0), iStack_18 != -1 &&
(iStack_18 != 0)))) {
auStack_36[iStack_18] = 0;
uStack_c = func_0x00400d10(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c60(iStack_14);
}
if (iStack_10 != -1) {
func_0x00400c60(iStack_10);
}
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_badSink(uStack_c);
return;
}
| ['gcc'] |
15,390 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54a.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,391 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_badSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_badSink(data);
} | [] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_badSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_badSink(param_1);
return;
}
| ['gcc'] |
15,392 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_goodG2BSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_goodG2BSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodG2BSink(param_1);
return;
}
| ['gcc'] |
15,393 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_goodB2GSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54b_goodB2GSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
15,394 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_badSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_badSink(data);
} | [] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_badSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_badSink(param_1);
return;
}
| ['gcc'] |
15,395 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodG2BSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodG2BSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodG2BSink(param_1);
return;
}
| ['gcc'] |
15,396 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodB2GSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54c_goodB2GSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
15,397 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_badSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54e_badSink(data);
} | [] | ['CWE121', 'CWE129'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_badSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_badSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54e_badSink(param_1);
return;
}
| ['gcc'] |
15,398 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodG2BSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54e_goodG2BSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodG2BSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodG2BSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54e_goodG2BSink(param_1);
return;
}
| ['gcc'] |
15,399 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodB2GSink(int data)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62740/CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodB2GSink |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54d_goodB2GSink(undefined4 param_1)
{
CWE121_Stack_Based_Buffer_Overflow__CWE129_listen_socket_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.