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,000 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122346/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,001 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b_badSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122346/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b_badSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b_badSink(undefined8 *param_1)
{
func_0x00400da0(&UNK_004016a0,&UNK_004016a0,&UNK_00401694,&UNK_00401684,*param_1,0);
return;
}
| ['gcc'] |
15,002 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b_goodG2BSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122346/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b_goodG2BSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_63b_goodG2BSink(undefined8 *param_1)
{
func_0x00400ad0(&UNK_00401220,&UNK_00401220,&UNK_00401214,&UNK_00401204,*param_1,0);
return;
}
| ['gcc'] |
15,003 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64_bad()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_badSink(&data);
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122347/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 auStack_1b8 [49];
undefined8 *puStack_30;
undefined4 *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_10;
int iStack_c;
uStack_1c8 = 0;
uStack_1c0 = 0;
puVar3 = auStack_1b8;
for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_30 = &uStack_1c8;
iStack_10 = 0xffffffff;
iStack_c = -1;
lStack_18 = func_0x00400cc0(puStack_30);
iStack_10 = func_0x00400dd0(2,1,6);
if (iStack_10 != -1) {
func_0x00400cd0(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400ca0(0x6987);
iVar1 = func_0x00400d70(iStack_10,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d60(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_10,0,0), iStack_c != -1)) &&
((iStack_1c = func_0x00400c70(iStack_c,(long)puStack_30 + lStack_18 * 4,(99 - lStack_18) * 4,
0), iStack_1c != -1 && (iStack_1c != 0)))) {
*(undefined4 *)((long)puStack_30 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0;
puStack_28 = (undefined4 *)func_0x00400d80(puStack_30,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400d80(puStack_30,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_10 != -1) {
func_0x00400ce0(iStack_10);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_badSink(&puStack_30);
return;
}
| ['gcc'] |
15,004 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122347/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,005 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr;
/* dereference dataPtr into data */
wchar_t * data = (*dataPtr);
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122347/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_badSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_badSink(undefined8 *param_1)
{
func_0x00400da0(&UNK_004016a0,&UNK_004016a0,&UNK_00401694,&UNK_00401684,*param_1,0);
return;
}
| ['gcc'] |
15,006 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_goodG2BSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr;
/* dereference dataPtr into data */
wchar_t * data = (*dataPtr);
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122347/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_goodG2BSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_64b_goodG2BSink(undefined8 *param_1)
{
func_0x00400ad0(&UNK_00401230,&UNK_00401230,&UNK_00401224,&UNK_00401214,*param_1,0);
return;
}
| ['gcc'] |
15,007 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65_bad()
{
wchar_t * data;
/* define a function pointer */
void (*funcPtr) (wchar_t *) = CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_badSink;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
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 */', '/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* use the function pointer */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122348/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 auStack_1c8 [49];
undefined4 *puStack_40;
int iStack_34;
long lStack_30;
int iStack_24;
undefined8 *puStack_20;
code *pcStack_18;
int iStack_c;
pcStack_18 = CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_badSink;
uStack_1d8 = 0;
uStack_1d0 = 0;
puVar3 = auStack_1c8;
for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_20 = &uStack_1d8;
iStack_24 = 0xffffffff;
iStack_c = -1;
lStack_30 = func_0x00400cc0(puStack_20);
iStack_24 = func_0x00400dd0(2,1,6);
if (iStack_24 != -1) {
func_0x00400cd0(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ca0(0x6987);
iVar1 = func_0x00400d70(iStack_24,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d60(iStack_24,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_24,0,0), iStack_c != -1)) &&
((iStack_34 = func_0x00400c70(iStack_c,lStack_30 * 4 + (long)puStack_20,(99 - lStack_30) * 4,
0), iStack_34 != -1 && (iStack_34 != 0)))) {
*(undefined4 *)((long)puStack_20 + (lStack_30 + ((ulong)(long)iStack_34 >> 2)) * 4) = 0;
puStack_40 = (undefined4 *)func_0x00400d80(puStack_20,0xd);
if (puStack_40 != (undefined4 *)0x0) {
*puStack_40 = 0;
}
puStack_40 = (undefined4 *)func_0x00400d80(puStack_20,10);
if (puStack_40 != (undefined4 *)0x0) {
*puStack_40 = 0;
}
}
}
if (iStack_24 != -1) {
func_0x00400ce0(iStack_24);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
(*pcStack_18)(puStack_20);
return;
}
| ['gcc'] |
15,008 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122348/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,009 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_badSink(wchar_t * data)
{
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122348/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_badSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_badSink(undefined8 param_1)
{
func_0x00400da0(&UNK_004016a0,&UNK_004016a0,&UNK_00401694,&UNK_00401684,param_1,0);
return;
}
| ['gcc'] |
15,010 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_goodG2BSink(wchar_t * data)
{
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122348/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_goodG2BSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_65b_goodG2BSink(undefined8 param_1)
{
func_0x00400ad0(&UNK_00401220,&UNK_00401220,&UNK_00401214,&UNK_00401204,param_1,0);
return;
}
| ['gcc'] |
15,011 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66_bad()
{
wchar_t * data;
wchar_t * dataArray[5];
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* put data in array */
dataArray[2] = data;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_badSink(dataArray);
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* put data in array */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122349/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_208;
undefined2 uStack_206;
undefined4 uStack_204;
undefined8 uStack_1f8;
undefined8 uStack_1f0;
undefined8 auStack_1e8 [48];
undefined auStack_68 [16];
undefined8 *puStack_58;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1f8 = 0;
uStack_1f0 = 0;
puVar3 = auStack_1e8;
for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1f8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400cc0(puStack_18);
iStack_1c = func_0x00400dd0(2,1,6);
if (iStack_1c != -1) {
func_0x00400cd0(&uStack_208,0,0x10);
uStack_208 = 2;
uStack_204 = 0;
uStack_206 = func_0x00400ca0(0x6987);
iVar1 = func_0x00400d70(iStack_1c,&uStack_208,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d60(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400c70(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400d80(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400d80(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400ce0(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
puStack_58 = puStack_18;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_badSink(auStack_68);
return;
}
| ['gcc'] |
15,012 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122349/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,013 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_badSink(wchar_t * dataArray[])
{
/* copy data out of dataArray */
wchar_t * data = dataArray[2];
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* copy data out of dataArray */', '/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122349/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_badSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_badSink(long param_1)
{
func_0x00400da0(&UNK_004016b0,&UNK_004016b0,&UNK_004016a4,&UNK_00401694,
*(undefined8 *)(param_1 + 0x10),0);
return;
}
| ['gcc'] |
15,014 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_goodG2BSink(wchar_t * dataArray[])
{
wchar_t * data = dataArray[2];
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122349/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_goodG2BSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_66b_goodG2BSink(long param_1)
{
func_0x00400ad0(&UNK_00401230,&UNK_00401230,&UNK_00401224,&UNK_00401214,
*(undefined8 *)(param_1 + 0x10),0);
return;
}
| ['gcc'] |
15,015 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_bad()
{
wchar_t * data;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_structType myStruct;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myStruct.structFirst = data;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_badSink(myStruct);
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122350/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 auStack_1c8 [49];
undefined8 *puStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0;
uStack_1d0 = 0;
puVar3 = auStack_1c8;
for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400cc0(puStack_18);
iStack_1c = func_0x00400dd0(2,1,6);
if (iStack_1c != -1) {
func_0x00400cd0(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ca0(0x6987);
iVar1 = func_0x00400d70(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d60(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400c70(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400d80(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400d80(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400ce0(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
puStack_40 = puStack_18;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_badSink(puStack_18);
return;
}
| ['gcc'] |
15,016 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122350/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,017 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_badSink(CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122350/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_badSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_badSink(undefined8 param_1)
{
func_0x00400da0(&UNK_004016b0,&UNK_004016b0,&UNK_004016a4,&UNK_00401694,param_1,0);
return;
}
| ['gcc'] |
15,018 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_goodG2BSink(CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122350/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_goodG2BSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_67b_goodG2BSink(undefined8 param_1)
{
func_0x00400ad0(&UNK_00401230,&UNK_00401230,&UNK_00401224,&UNK_00401214,param_1,0);
return;
}
| ['gcc'] |
15,019 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_bad()
{
wchar_t * data;
wchar_t dataBuffer[100] = L"";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_badData = data;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_badSink();
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122351/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 auStack_1b8 [48];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0;
uStack_1c0 = 0;
puVar3 = auStack_1b8;
for (lVar2 = 0x30; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400cc0(puStack_18);
iStack_1c = func_0x00400dd0(2,1,6);
if (iStack_1c != -1) {
func_0x00400cd0(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400ca0(0x6987);
iVar1 = func_0x00400d70(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400d60(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400d90(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400c70(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400d80(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400d80(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400ce0(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400ce0(iStack_c);
}
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_badData = puStack_18;
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_badSink();
return;
}
| ['gcc'] |
15,020 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122351/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,021 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_badSink()
{
wchar_t * data = CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_badData;
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122351/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_badSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_badSink(void)
{
func_0x00400da0(&UNK_004016b0,&UNK_004016b0,&UNK_004016a4,&UNK_00401694,
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_badData,0);
return;
}
| ['gcc'] |
15,022 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_goodG2BSink()
{
wchar_t * data = CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_goodG2BData;
/* wexeclp - searches for the location of the command among
* the directories specified by the PATH environment variable */
/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */
EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL);
} | ['/* wexeclp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122351/CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_goodG2BSink |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68b_goodG2BSink(void)
{
func_0x00400ad0(&UNK_00401230,&UNK_00401230,&UNK_00401224,&UNK_00401214,
CWE78_OS_Command_Injection__wchar_t_listen_socket_execlp_68_goodG2BData,0);
return;
}
| ['gcc'] |
15,023 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122359/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401724);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,024 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122359/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_01_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,025 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122360/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401724);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,026 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122360/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_02_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,027 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(5==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122361/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401724);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,028 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122361/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_03_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,029 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(STATIC_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122362/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_0040172c);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,030 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122362/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_04_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,031 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(staticTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122363/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
if (staticTrue != 0) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401724);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,032 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122363/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_05_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,033 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(STATIC_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122364/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401728);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,034 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122364/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_06_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,035 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(staticFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122365/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
if (staticFive == 5) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401734);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,036 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122365/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_07_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,037 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(staticReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122366/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401744);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,038 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122366/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_08_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,039 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(GLOBAL_CONST_TRUE)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122367/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
if (GLOBAL_CONST_TRUE != 0) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401724);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,040 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122367/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_09_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,041 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(globalTrue)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122368/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
if (globalTrue != 0) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401724);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,042 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122368/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_10_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,043 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(globalReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
{
FILE *pipe;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
pipe = POPEN(data, L"wb");
if (pipe != NULL)
{
PCLOSE(pipe);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122369/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [43];
long lStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d00(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400ce0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400df0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400de0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
lStack_40 = func_0x00400dd0(puStack_18,&UNK_00401734);
if (lStack_40 != 0) {
func_0x00400d10(lStack_40);
}
return;
}
| ['gcc'] |
15,044 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122369/CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_popen_11_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,045 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122407/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401714);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,046 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122407/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_01_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,047 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122408/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401714);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,048 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122408/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_02_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,049 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(5==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122409/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401714);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,050 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122409/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_03_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,051 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
if(globalFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122420/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
if (globalFive == 5) {
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401724);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,052 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122420/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_14_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,053 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
switch(6)
{
case 6:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
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;
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122421/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401714);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,054 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122421/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_15_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,055 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
while(1)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
break;
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122422/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401714);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,056 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122422/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_16_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,057 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_bad()
{
int i;
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
for(i = 0; i < 1; i++)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122423/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_10;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
iStack_1c = 0xffffffff;
iStack_10 = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_10 = func_0x00400de0(iStack_1c,0,0), iStack_10 != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_10,lStack_28 * 4 + (long)puStack_18,
(99 - lStack_28) * 4,0), iStack_2c != -1 && (iStack_2c != 0))
)) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_10 != -1) {
func_0x00400d30(iStack_10);
}
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401734);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,058 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122423/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_17_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,059 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
goto source;
source:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122424/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1d8;
undefined2 uStack_1d6;
undefined4 uStack_1d4;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 auStack_188 [42];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1c8 = 0x620000002f;
uStack_1c0 = 0x6e00000069;
uStack_1b8 = 0x730000002f;
uStack_1b0 = 0x2000000068;
uStack_1a8 = 0x730000006c;
uStack_1a0 = 0x2d00000020;
uStack_198 = 0x610000006c;
uStack_190 = 0x20;
puVar3 = auStack_188;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1c8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1d8,0,0x10);
uStack_1d8 = 2;
uStack_1d4 = 0;
uStack_1d6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1d8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401714);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,060 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122424/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_18_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,061 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
badStatic = 1; /* true */
data = badSource(data);
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* true */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122425/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 uStack_188;
undefined8 uStack_180;
undefined8 uStack_178;
undefined8 uStack_170;
undefined8 auStack_168 [43];
undefined8 *puStack_10;
uStack_1a8 = 0x620000002f;
uStack_1a0 = 0x6e00000069;
uStack_198 = 0x730000002f;
uStack_190 = 0x2000000068;
uStack_188 = 0x730000006c;
uStack_180 = 0x2d00000020;
uStack_178 = 0x610000006c;
uStack_170 = 0x20;
puVar3 = auStack_168;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_1a8;
badStatic = 1;
puStack_10 = (undefined8 *)badSource(puStack_10);
iVar1 = func_0x00400ce0(puStack_10);
if (iVar1 < 1) {
printLine(&UNK_00401744);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,062 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122425/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_21_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,063 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badGlobal = 1; /* true */
data = CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badSource(data);
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
} | ['/* true */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122426/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 uStack_198;
undefined8 uStack_190;
undefined8 uStack_188;
undefined8 uStack_180;
undefined8 uStack_178;
undefined8 uStack_170;
undefined8 auStack_168 [43];
undefined8 *puStack_10;
uStack_1a8 = 0x620000002f;
uStack_1a0 = 0x6e00000069;
uStack_198 = 0x730000002f;
uStack_190 = 0x2000000068;
uStack_188 = 0x730000006c;
uStack_180 = 0x2d00000020;
uStack_178 = 0x610000006c;
uStack_170 = 0x20;
puVar3 = auStack_168;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_1a8;
CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badGlobal = 1;
puStack_10 = (undefined8 *)
CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badSource(puStack_10);
iVar1 = func_0x00400ce0(puStack_10);
if (iVar1 < 1) {
printLine(&UNK_00401744);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,064 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_good()
{
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122426/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22a.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_good(void)
{
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,065 | wchar_t * CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badSource(wchar_t * data)
{
if(CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badGlobal)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
return data;
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122426/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badSource |
long CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badSource(long param_1)
{
int iVar1;
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined4 *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_10;
int iStack_c;
if (CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_badGlobal != 0) {
iStack_10 = 0xffffffff;
iStack_c = -1;
lStack_18 = func_0x00400d10(param_1);
iStack_10 = func_0x00400e20(2,1,6);
if (iStack_10 != -1) {
func_0x00400d20(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = 0;
uStack_36 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_10,&uStack_38,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_10,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_10,0,0), iStack_c != -1)) &&
((iStack_1c = func_0x00400cb0(iStack_c,lStack_18 * 4 + param_1,(99 - lStack_18) * 4,0),
iStack_1c != -1 && (iStack_1c != 0)))) {
*(undefined4 *)(param_1 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0;
puStack_28 = (undefined4 *)func_0x00400dd0(param_1,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400dd0(param_1,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_10 != -1) {
func_0x00400d30(iStack_10);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
}
return param_1;
}
| ['gcc'] |
15,066 | wchar_t * CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B1Source(wchar_t * data)
{
if(CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
}
return data;
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Append a fixed string to data (not user / external input) */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122426/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B1Source |
undefined8
CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B1Source(undefined8 param_1)
{
if (CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B1Global == 0) {
func_0x00400a60(param_1,&UNK_0040141c);
}
else {
printLine(&UNK_00401404);
}
return param_1;
}
| ['gcc'] |
15,067 | wchar_t * CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B2Source(wchar_t * data)
{
if(CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B2Global)
{
/* FIX: Append a fixed string to data (not user / external input) */
wcscat(data, L"*.*");
}
return data;
} | ['/* FIX: Append a fixed string to data (not user / external input) */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122426/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22b.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B2Source |
undefined8
CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B2Source(undefined8 param_1)
{
if (CWE78_OS_Command_Injection__wchar_t_listen_socket_system_22_goodG2B2Global != 0) {
func_0x00400a60(param_1,&UNK_0040141c);
}
return param_1;
}
| ['gcc'] |
15,068 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31_bad()
{
wchar_t * data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
wchar_t * dataCopy = data;
wchar_t * data = dataCopy;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122427/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1e8;
undefined2 uStack_1e6;
undefined4 uStack_1e4;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 uStack_1a8;
undefined8 uStack_1a0;
undefined8 auStack_198 [42];
undefined8 *puStack_48;
undefined8 *puStack_40;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_1d8 = 0x620000002f;
uStack_1d0 = 0x6e00000069;
uStack_1c8 = 0x730000002f;
uStack_1c0 = 0x2000000068;
uStack_1b8 = 0x730000006c;
uStack_1b0 = 0x2d00000020;
uStack_1a8 = 0x610000006c;
uStack_1a0 = 0x20;
puVar3 = auStack_198;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_1d8;
iStack_1c = 0xffffffff;
iStack_c = -1;
lStack_28 = func_0x00400d10(puStack_18);
iStack_1c = func_0x00400e20(2,1,6);
if (iStack_1c != -1) {
func_0x00400d20(&uStack_1e8,0,0x10);
uStack_1e8 = 2;
uStack_1e4 = 0;
uStack_1e6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_1c,&uStack_1e8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_1c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_1c,0,0), iStack_c != -1)) &&
((iStack_2c = func_0x00400cb0(iStack_c,lStack_28 * 4 + (long)puStack_18,(99 - lStack_28) * 4,
0), iStack_2c != -1 && (iStack_2c != 0)))) {
*(undefined4 *)((long)puStack_18 + (lStack_28 + ((ulong)(long)iStack_2c >> 2)) * 4) = 0;
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400dd0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d30(iStack_1c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
puStack_40 = puStack_18;
puStack_48 = puStack_18;
iVar1 = func_0x00400ce0(puStack_18);
if (iVar1 < 1) {
printLine(&UNK_00401724);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,069 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122427/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_31_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,070 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32_bad()
{
wchar_t * data;
wchar_t * *dataPtr1 = &data;
wchar_t * *dataPtr2 = &data;
wchar_t data_buf[100] = FULL_COMMAND;
data = data_buf;
{
wchar_t * data = *dataPtr1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
size_t dataLen = wcslen(data);
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, (char *)(data + dataLen), sizeof(wchar_t) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
*dataPtr1 = data;
}
{
wchar_t * data = *dataPtr2;
/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */
if (SYSTEM(data) <= 0)
{
printLine("command execution failed!");
exit(1);
}
}
} | ['/* POTENTIAL FLAW: Read data using a listen socket */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */'] | ['CWE78'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122428/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32_bad |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_1f8;
undefined2 uStack_1f6;
undefined4 uStack_1f4;
undefined8 uStack_1e8;
undefined8 uStack_1e0;
undefined8 uStack_1d8;
undefined8 uStack_1d0;
undefined8 uStack_1c8;
undefined8 uStack_1c0;
undefined8 uStack_1b8;
undefined8 uStack_1b0;
undefined8 auStack_1a8 [42];
undefined8 *puStack_58;
undefined8 *puStack_50;
undefined4 *puStack_48;
int iStack_3c;
long lStack_38;
int iStack_2c;
undefined8 *puStack_28;
undefined8 **ppuStack_20;
undefined8 **ppuStack_18;
int iStack_c;
ppuStack_18 = &puStack_58;
ppuStack_20 = &puStack_58;
uStack_1e8 = 0x620000002f;
uStack_1e0 = 0x6e00000069;
uStack_1d8 = 0x730000002f;
uStack_1d0 = 0x2000000068;
uStack_1c8 = 0x730000006c;
uStack_1c0 = 0x2d00000020;
uStack_1b8 = 0x610000006c;
uStack_1b0 = 0x20;
puVar3 = auStack_1a8;
for (lVar2 = 0x2a; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_58 = &uStack_1e8;
puStack_28 = *ppuStack_18;
iStack_2c = 0xffffffff;
iStack_c = -1;
lStack_38 = func_0x00400d10(puStack_28);
iStack_2c = func_0x00400e20(2,1,6);
if (iStack_2c != -1) {
func_0x00400d20(&uStack_1f8,0,0x10);
uStack_1f8 = 2;
uStack_1f4 = 0;
uStack_1f6 = func_0x00400cf0(0x6987);
iVar1 = func_0x00400dc0(iStack_2c,&uStack_1f8,0x10);
if ((((iVar1 != -1) && (iVar1 = func_0x00400db0(iStack_2c,5), iVar1 != -1)) &&
(iStack_c = func_0x00400de0(iStack_2c,0,0), iStack_c != -1)) &&
((iStack_3c = func_0x00400cb0(iStack_c,lStack_38 * 4 + (long)puStack_28,(99 - lStack_38) * 4,
0), iStack_3c != -1 && (iStack_3c != 0)))) {
*(undefined4 *)((long)puStack_28 + (lStack_38 + ((ulong)(long)iStack_3c >> 2)) * 4) = 0;
puStack_48 = (undefined4 *)func_0x00400dd0(puStack_28,0xd);
if (puStack_48 != (undefined4 *)0x0) {
*puStack_48 = 0;
}
puStack_48 = (undefined4 *)func_0x00400dd0(puStack_28,10);
if (puStack_48 != (undefined4 *)0x0) {
*puStack_48 = 0;
}
}
}
if (iStack_2c != -1) {
func_0x00400d30(iStack_2c);
}
if (iStack_c != -1) {
func_0x00400d30(iStack_c);
}
*ppuStack_18 = puStack_28;
puStack_50 = *ppuStack_20;
iVar1 = func_0x00400ce0(puStack_50);
if (iVar1 < 1) {
printLine(&UNK_00401744);
func_0x00400df0(1);
}
return;
}
| ['gcc'] |
15,071 | void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32_good()
{
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/122428/CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32.c | CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32_good |
void CWE78_OS_Command_Injection__wchar_t_listen_socket_system_32_good(void)
{
goodG2B();
return;
}
| ['gcc'] |
15,072 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01_bad()
{
int data;
/* Initialize data */
data = -1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
int 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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62516/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014a8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014b8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
return;
}
| ['gcc'] |
15,073 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01_good()
{
goodG2B();
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62516/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_01_good(void)
{
goodG2B();
goodB2G();
return;
}
| ['gcc'] |
15,074 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62517/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014a8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014b8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
return;
}
| ['gcc'] |
15,075 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62517/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_02_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,076 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62518/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014a8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014b8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
return;
}
| ['gcc'] |
15,077 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62518/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_03_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,078 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62519/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014c0);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014d0);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
return;
}
| ['gcc'] |
15,079 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62519/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_04_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,080 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62520/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
if (staticTrue != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014b8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
if (staticTrue != 0) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,081 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62520/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_05_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,082 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62521/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014bc);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
return;
}
| ['gcc'] |
15,083 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62521/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,084 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62522/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
if (staticFive == 5) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014b8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
if (staticFive == 5) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,085 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62522/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,086 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62523/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014d8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014e8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,087 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62523/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,088 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62524/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
if (GLOBAL_CONST_TRUE != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014b8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
if (GLOBAL_CONST_TRUE != 0) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,089 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62524/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,090 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62525/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
if (globalTrue != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014b8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
if (globalTrue != 0) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,091 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62525/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,092 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62526/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014c8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (((iVar1 != -1) &&
(iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0), iStack_18 != -1)) &&
(iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014d8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,093 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62526/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_11_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,094 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* 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/62527/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_12.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_12_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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_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_18 = 0xffffffff;
iStack_18 = func_0x00400cf0(2,1,6);
if (iStack_18 != -1) {
func_0x00400c10(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400c60(&UNK_00401538);
uStack_36 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_18,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400bc0(iStack_18,auStack_46,0xd,0), iStack_1c != -1)) &&
(iStack_1c != 0)) {
auStack_46[iStack_1c] = 0;
iStack_c = func_0x00400cb0(auStack_46);
}
}
if (iStack_18 != -1) {
func_0x00400c20(iStack_18);
}
}
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_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));
}
}
}
else {
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_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_78 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,095 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_12_good()
{
goodB2G();
goodG2B();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62527/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_12.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_12_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_12_good(void)
{
goodB2G();
goodG2B();
return;
}
| ['gcc'] |
15,096 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62528/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
if (GLOBAL_CONST_FIVE == 5) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014b8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
if (GLOBAL_CONST_FIVE == 5) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,097 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62528/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_13_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
15,098 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_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 connectSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a connect socket */
connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (connectSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = inet_addr(IP_ADDRESS);
service.sin_port = htons(TCP_PORT);
if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed, make sure to recv one
* less char than is in the recv_buf in order to append a terminator */
recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
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 connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* NUL-terminate the string */', '/* Convert to int */', '/* POTENTIAL FLAW: 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/62529/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14_bad |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14_bad(void)
{
int iVar1;
undefined8 uStack_68;
undefined8 uStack_60;
undefined8 uStack_58;
undefined8 uStack_50;
undefined8 uStack_48;
undefined auStack_36 [14];
undefined2 uStack_28;
undefined2 uStack_26;
undefined4 uStack_24;
int iStack_18;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_c = -1;
if (globalFive == 5) {
iStack_14 = 0xffffffff;
iStack_14 = func_0x00400cf0(2,1,6);
if (iStack_14 != -1) {
func_0x00400c10(&uStack_28,0,0x10);
uStack_28 = 2;
uStack_24 = func_0x00400c60(&UNK_004014b8);
uStack_26 = func_0x00400bf0(0x6987);
iVar1 = func_0x00400cc0(iStack_14,&uStack_28,0x10);
if (iVar1 != -1) {
iStack_18 = func_0x00400bc0(iStack_14,auStack_36,0xd,0);
if ((iStack_18 != -1) && (iStack_18 != 0)) {
auStack_36[iStack_18] = 0;
iStack_c = func_0x00400cb0(auStack_36);
}
}
}
if (iStack_14 != -1) {
func_0x00400c20(iStack_14);
}
}
if (globalFive == 5) {
uStack_68 = 0;
uStack_60 = 0;
uStack_58 = 0;
uStack_50 = 0;
uStack_48 = 0;
if (iStack_c < 0) {
printLine(&UNK_004014c8);
}
else {
*(undefined4 *)((long)&uStack_68 + (long)iStack_c * 4) = 1;
for (iStack_10 = 0; iStack_10 < 10; iStack_10 = iStack_10 + 1) {
printIntLine(*(undefined4 *)((long)&uStack_68 + (long)iStack_10 * 4));
}
}
}
return;
}
| ['gcc'] |
15,099 | void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/62529/CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14.c | CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14_good |
void CWE121_Stack_Based_Buffer_Overflow__CWE129_connect_socket_14_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.