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 |
|---|---|---|---|---|---|---|---|---|
2,300
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(globalReturnsTrue())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103106/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015e4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,301
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103106/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_11_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,302
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(globalReturnsTrueOrFalse())
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
else
{
/* FIX: Set the path as the "system" path */
wcscat(data, NEW_PATH);
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* FIX: Set the path as the "system" path */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103107/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
func_0x00400c80(puStack_10,&UNK_00401650);
}
else {
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d50(&UNK_00401644);
uStack_426 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400da0(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400da0(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d00(iStack_14);
}
}
func_0x00400d40(puStack_10);
return;
}
|
['gcc']
|
2,303
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103107/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_12_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,304
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(GLOBAL_CONST_FIVE==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103108/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
if (GLOBAL_CONST_FIVE == 5) {
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015e4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,305
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103108/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_13_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,306
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(globalFive==5)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103109/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
if (globalFive == 5) {
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015e4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
}
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,307
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103109/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_14_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,308
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
switch(6)
{
case 6:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#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: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* 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: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103110/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015d4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,309
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103110/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_15_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,310
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17_bad()
{
int i;
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
for(i = 0; i < 1; i++)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103112/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_438;
undefined2 uStack_436;
undefined4 uStack_434;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 auStack_408 [122];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
int iStack_c;
uStack_428 = 0x4100000050;
uStack_420 = 0x4800000054;
uStack_418 = 0x3d;
uStack_410 = 0;
puVar3 = auStack_408;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_428;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
iStack_1c = 0xffffffff;
lStack_28 = func_0x00400c90(puStack_18);
iStack_1c = func_0x00400d90(2,1,6);
if (iStack_1c != -1) {
func_0x00400ca0(&uStack_438,0,0x10);
uStack_438 = 2;
uStack_434 = func_0x00400d00(&UNK_004015f4);
uStack_436 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_1c,&uStack_438,0x10);
if (((iVar1 != -1) &&
(iStack_2c = func_0x00400c40(iStack_1c,lStack_28 * 4 + (long)puStack_18,
(0xf9 - 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_0x00400d50(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400d50(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400cb0(iStack_1c);
}
}
func_0x00400cf0(puStack_18);
return;
}
|
['gcc']
|
2,311
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103112/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_17_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,312
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
goto source;
source:
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103113/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015d4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,313
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103113/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_18_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,314
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
badStatic = 1; /* true */
data = badSource(data);
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* true */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103114/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 uStack_3e8;
undefined8 uStack_3e0;
undefined8 auStack_3d8 [121];
undefined8 *puStack_10;
uStack_3f8 = 0x4100000050;
uStack_3f0 = 0x4800000054;
uStack_3e8 = 0x3d;
uStack_3e0 = 0;
puVar2 = auStack_3d8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_3f8;
badStatic = 1;
puStack_10 = (undefined8 *)badSource(puStack_10);
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,315
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103114/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_21_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,316
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103115/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,317
|
wchar_t * CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_badSource(wchar_t * data)
{
if(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_badGlobal)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
}
return data;
}
|
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103115/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_badSource
|
long CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_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_c;
if (CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_badGlobal != 0) {
iStack_c = 0xffffffff;
lStack_18 = func_0x00400c90(param_1);
iStack_c = func_0x00400d90(2,1,6);
if (iStack_c != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400d00(&UNK_00401604);
uStack_36 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c40(iStack_c,lStack_18 * 4 + param_1,(0xf9 - 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_0x00400d50(param_1,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400d50(param_1,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400cb0(iStack_c);
}
}
return param_1;
}
|
['gcc']
|
2,318
|
wchar_t * CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B1Source(wchar_t * data)
{
if(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Set the path as the "system" path */
wcscat(data, NEW_PATH);
}
return data;
}
|
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Set the path as the "system" path */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103115/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B1Source
|
undefined8
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B1Source
(undefined8 param_1)
{
if (CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B1Global == 0) {
func_0x00400a20(param_1,&UNK_0040130c);
}
else {
printLine(&UNK_004012f4);
}
return param_1;
}
|
['gcc']
|
2,319
|
wchar_t * CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B2Source(wchar_t * data)
{
if(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B2Global)
{
/* FIX: Set the path as the "system" path */
wcscat(data, NEW_PATH);
}
return data;
}
|
['/* FIX: Set the path as the "system" path */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103115/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B2Source
|
undefined8
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B2Source
(undefined8 param_1)
{
if (CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_22_goodG2B2Global != 0) {
func_0x00400a20(param_1,&UNK_0040130c);
}
return param_1;
}
|
['gcc']
|
2,320
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
{
wchar_t * dataCopy = data;
wchar_t * data = dataCopy;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103116/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_438;
undefined2 uStack_436;
undefined4 uStack_434;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 auStack_408 [121];
undefined8 *puStack_40;
undefined8 *puStack_38;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_428 = 0x4100000050;
uStack_420 = 0x4800000054;
uStack_418 = 0x3d;
uStack_410 = 0;
puVar3 = auStack_408;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_428;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_438,0,0x10);
uStack_438 = 2;
uStack_434 = func_0x00400d00(&UNK_004015e4);
uStack_436 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_438,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
puStack_38 = puStack_10;
puStack_40 = puStack_10;
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,321
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103116/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_31_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,322
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32_bad()
{
wchar_t * data;
wchar_t * *dataPtr1 = &data;
wchar_t * *dataPtr2 = &data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
wchar_t * data = *dataPtr1;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
*dataPtr1 = data;
}
{
wchar_t * data = *dataPtr2;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103117/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_448;
undefined2 uStack_446;
undefined4 uStack_444;
undefined8 uStack_438;
undefined8 uStack_430;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 auStack_418 [121];
undefined8 *puStack_50;
undefined8 *puStack_48;
undefined4 *puStack_40;
int iStack_34;
long lStack_30;
int iStack_24;
undefined8 *puStack_20;
undefined8 **ppuStack_18;
undefined8 **ppuStack_10;
ppuStack_10 = &puStack_50;
ppuStack_18 = &puStack_50;
uStack_438 = 0x4100000050;
uStack_430 = 0x4800000054;
uStack_428 = 0x3d;
uStack_420 = 0;
puVar3 = auStack_418;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_50 = &uStack_438;
puStack_20 = *ppuStack_10;
iStack_24 = 0xffffffff;
lStack_30 = func_0x00400c90(puStack_20);
iStack_24 = func_0x00400d90(2,1,6);
if (iStack_24 != -1) {
func_0x00400ca0(&uStack_448,0,0x10);
uStack_448 = 2;
uStack_444 = func_0x00400d00(&UNK_00401604);
uStack_446 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_24,&uStack_448,0x10);
if (((iVar1 != -1) &&
(iStack_34 = func_0x00400c40(iStack_24,lStack_30 * 4 + (long)puStack_20,
(0xf9 - 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_0x00400d50(puStack_20,0xd);
if (puStack_40 != (undefined4 *)0x0) {
*puStack_40 = 0;
}
puStack_40 = (undefined4 *)func_0x00400d50(puStack_20,10);
if (puStack_40 != (undefined4 *)0x0) {
*puStack_40 = 0;
}
}
}
if (iStack_24 != -1) {
func_0x00400cb0(iStack_24);
}
*ppuStack_10 = puStack_20;
puStack_48 = *ppuStack_18;
func_0x00400cf0(puStack_48);
return;
}
|
['gcc']
|
2,323
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103117/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_32_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,324
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_bad()
{
wchar_t * data;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_unionType myUnion;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myUnion.unionFirst = data;
{
wchar_t * data = myUnion.unionSecond;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103119/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_438;
undefined2 uStack_436;
undefined4 uStack_434;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 auStack_408 [121];
undefined8 *puStack_40;
undefined8 *puStack_38;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_428 = 0x4100000050;
uStack_420 = 0x4800000054;
uStack_418 = 0x3d;
uStack_410 = 0;
puVar3 = auStack_408;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_428;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_438,0,0x10);
uStack_438 = 2;
uStack_434 = func_0x00400d00(&UNK_004015e4);
uStack_436 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_438,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
puStack_40 = puStack_10;
puStack_38 = puStack_10;
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,325
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103119/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_34_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,326
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_badSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103120/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,327
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103120/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015f4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_badSink(puStack_10);
return;
}
|
['gcc']
|
2,328
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_goodG2BSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103120/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,329
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103120/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_41_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,330
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
data = badSource(data);
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103121/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 uStack_3e8;
undefined8 uStack_3e0;
undefined8 auStack_3d8 [121];
undefined8 *puStack_10;
uStack_3f8 = 0x4100000050;
uStack_3f0 = 0x4800000054;
uStack_3e8 = 0x3d;
uStack_3e0 = 0;
puVar2 = auStack_3d8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_3f8;
puStack_10 = (undefined8 *)badSource(puStack_10);
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,331
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103121/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_42_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,332
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44_bad()
{
wchar_t * data;
/* define a function pointer */
void (*funcPtr) (wchar_t *) = badSink;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
}
|
['/* define a function pointer */', '/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* use the function pointer */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103123/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_438;
undefined2 uStack_436;
undefined4 uStack_434;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 auStack_408 [122];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
code *pcStack_10;
pcStack_10 = badSink;
uStack_428 = 0x4100000050;
uStack_420 = 0x4800000054;
uStack_418 = 0x3d;
uStack_410 = 0;
puVar3 = auStack_408;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_428;
iStack_1c = 0xffffffff;
lStack_28 = func_0x00400c90(puStack_18);
iStack_1c = func_0x00400d90(2,1,6);
if (iStack_1c != -1) {
func_0x00400ca0(&uStack_438,0,0x10);
uStack_438 = 2;
uStack_434 = func_0x00400d00(&UNK_004015f4);
uStack_436 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_1c,&uStack_438,0x10);
if (((iVar1 != -1) &&
(iStack_2c = func_0x00400c40(iStack_1c,lStack_28 * 4 + (long)puStack_18,
(0xf9 - 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_0x00400d50(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400d50(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400cb0(iStack_1c);
}
(*pcStack_10)(puStack_18);
return;
}
|
['gcc']
|
2,333
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103123/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_44_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,334
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_badData = data;
badSink();
}
|
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103124/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_00401604);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_badData = puStack_10;
badSink();
return;
}
|
['gcc']
|
2,335
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103124/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_45_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,336
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103125/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015f4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_badSink(puStack_10);
return;
}
|
['gcc']
|
2,337
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103125/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,338
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_badSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103125/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,339
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_goodG2BSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103125/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_51b_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,340
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103126/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_00401604);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_badSink(puStack_10);
return;
}
|
['gcc']
|
2,341
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103126/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,342
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_badSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_badSink(data);
}
|
[]
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103126/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_badSink(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_badSink(param_1);
return;
}
|
['gcc']
|
2,343
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_goodG2BSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_goodG2BSink(data);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103126/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52b_goodG2BSink
(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
2,344
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_badSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103126/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,345
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_goodG2BSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103126/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_52c_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,346
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_00401624);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_badSink(puStack_10);
return;
}
|
['gcc']
|
2,347
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,348
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_badSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_badSink(data);
}
|
[]
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_badSink(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_badSink(param_1);
return;
}
|
['gcc']
|
2,349
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_goodG2BSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_goodG2BSink(data);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53b_goodG2BSink
(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
2,350
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_badSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_badSink(data);
}
|
[]
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_badSink(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_badSink(param_1);
return;
}
|
['gcc']
|
2,351
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_goodG2BSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_goodG2BSink(data);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53c_goodG2BSink
(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_goodG2BSink(param_1);
return;
}
|
['gcc']
|
2,352
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_badSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,353
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_goodG2BSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103127/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_53d_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,354
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_badSink(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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_00401644);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_badSink(puStack_10);
return;
}
|
['gcc']
|
2,355
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,356
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_badSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_badSink(data);
}
|
[]
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_badSink(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_badSink(param_1);
return;
}
|
['gcc']
|
2,357
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_goodG2BSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_goodG2BSink(data);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54b_goodG2BSink
(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
2,358
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_badSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_badSink(data);
}
|
[]
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_badSink(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_badSink(param_1);
return;
}
|
['gcc']
|
2,359
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_goodG2BSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_goodG2BSink(data);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54c_goodG2BSink
(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_goodG2BSink(param_1);
return;
}
|
['gcc']
|
2,360
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_badSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_badSink(data);
}
|
[]
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_badSink(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_badSink(param_1);
return;
}
|
['gcc']
|
2,361
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_goodG2BSink(wchar_t * data)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_goodG2BSink(data);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54d_goodG2BSink
(undefined8 param_1)
{
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_goodG2BSink(param_1);
return;
}
|
['gcc']
|
2,362
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_badSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,363
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_goodG2BSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103128/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_54e_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,364
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
data = CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_badSource(data);
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103129/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 uStack_3e8;
undefined8 uStack_3e0;
undefined8 auStack_3d8 [121];
undefined8 *puStack_10;
uStack_3f8 = 0x4100000050;
uStack_3f0 = 0x4800000054;
uStack_3e8 = 0x3d;
uStack_3e0 = 0;
puVar2 = auStack_3d8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_3f8;
puStack_10 = (undefined8 *)
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_badSource
(puStack_10);
func_0x00400cf0(puStack_10);
return;
}
|
['gcc']
|
2,365
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103129/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,366
|
wchar_t * CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_badSource(wchar_t * data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
}
|
['/* POTENTIAL FLAW: Read data using a connect socket */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103129/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_badSource
|
long CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_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_c;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400c90(param_1);
iStack_c = func_0x00400d90(2,1,6);
if (iStack_c != -1) {
func_0x00400ca0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400d00(&UNK_004015e4);
uStack_36 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c40(iStack_c,lStack_18 * 4 + param_1,(0xf9 - 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_0x00400d50(param_1,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400d50(param_1,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400cb0(iStack_c);
}
return param_1;
}
|
['gcc']
|
2,367
|
wchar_t * CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_goodG2BSource(wchar_t * data)
{
/* FIX: Set the path as the "system" path */
wcscat(data, NEW_PATH);
return data;
}
|
['/* FIX: Set the path as the "system" path */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103129/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_goodG2BSource
|
undefined8
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_61b_goodG2BSource
(undefined8 param_1)
{
func_0x00400a20(param_1,&UNK_00401204);
return param_1;
}
|
['gcc']
|
2,368
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_badSink(&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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103131/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined8 *puStack_30;
undefined4 *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_30 = &uStack_418;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400c90(puStack_30);
iStack_c = func_0x00400d90(2,1,6);
if (iStack_c != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015f4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_c,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c40(iStack_c,(long)puStack_30 + lStack_18 * 4,
(0xf9 - 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_0x00400d50(puStack_30,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400d50(puStack_30,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400cb0(iStack_c);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_badSink(&puStack_30);
return;
}
|
['gcc']
|
2,369
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103131/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,370
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_badSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103131/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_badSink
(undefined8 *param_1)
{
func_0x00400cf0(*param_1);
return;
}
|
['gcc']
|
2,371
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_goodG2BSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103131/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_63b_goodG2BSink
(undefined8 *param_1)
{
func_0x00400a90(*param_1);
return;
}
|
['gcc']
|
2,372
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b_badSink(&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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103132/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined8 *puStack_30;
undefined4 *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_30 = &uStack_418;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400c90(puStack_30);
iStack_c = func_0x00400d90(2,1,6);
if (iStack_c != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_004015f4);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_c,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c40(iStack_c,(long)puStack_30 + lStack_18 * 4,
(0xf9 - 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_0x00400d50(puStack_30,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400d50(puStack_30,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400cb0(iStack_c);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b_badSink(&puStack_30);
return;
}
|
['gcc']
|
2,373
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103132/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,374
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_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);
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103132/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b_badSink
(undefined8 *param_1)
{
func_0x00400cf0(*param_1);
return;
}
|
['gcc']
|
2,375
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_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);
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103132/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_64b_goodG2BSink
(undefined8 *param_1)
{
func_0x00400a90(*param_1);
return;
}
|
['gcc']
|
2,376
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65_bad()
{
wchar_t * data;
/* define a function pointer */
void (*funcPtr) (wchar_t *) = CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_badSink;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* use the function pointer */
funcPtr(data);
}
|
['/* define a function pointer */', '/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* use the function pointer */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103133/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_438;
undefined2 uStack_436;
undefined4 uStack_434;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 auStack_408 [122];
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined8 *puStack_18;
code *pcStack_10;
pcStack_10 = CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_badSink;
uStack_428 = 0x4100000050;
uStack_420 = 0x4800000054;
uStack_418 = 0x3d;
uStack_410 = 0;
puVar3 = auStack_408;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_18 = &uStack_428;
iStack_1c = 0xffffffff;
lStack_28 = func_0x00400c90(puStack_18);
iStack_1c = func_0x00400d90(2,1,6);
if (iStack_1c != -1) {
func_0x00400ca0(&uStack_438,0,0x10);
uStack_438 = 2;
uStack_434 = func_0x00400d00(&UNK_004015f4);
uStack_436 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_1c,&uStack_438,0x10);
if (((iVar1 != -1) &&
(iStack_2c = func_0x00400c40(iStack_1c,lStack_28 * 4 + (long)puStack_18,
(0xf9 - 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_0x00400d50(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400d50(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400cb0(iStack_1c);
}
(*pcStack_10)(puStack_18);
return;
}
|
['gcc']
|
2,377
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103133/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,378
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_badSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103133/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,379
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_goodG2BSink(wchar_t * data)
{
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103133/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_65b_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,380
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66_bad()
{
wchar_t * data;
wchar_t * dataArray[5];
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* put data in array */
dataArray[2] = data;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_badSink(dataArray);
}
|
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */', '/* put data in array */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103134/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_458;
undefined2 uStack_456;
undefined4 uStack_454;
undefined8 uStack_448;
undefined8 uStack_440;
undefined8 uStack_438;
undefined8 uStack_430;
undefined8 auStack_428 [122];
undefined auStack_58 [16];
undefined8 *puStack_48;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_448 = 0x4100000050;
uStack_440 = 0x4800000054;
uStack_438 = 0x3d;
uStack_430 = 0;
puVar3 = auStack_428;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_448;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_458,0,0x10);
uStack_458 = 2;
uStack_454 = func_0x00400d00(&UNK_00401604);
uStack_456 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_458,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
puStack_48 = puStack_10;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_badSink(auStack_58);
return;
}
|
['gcc']
|
2,381
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103134/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,382
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_badSink(wchar_t * dataArray[])
{
/* copy data out of dataArray */
wchar_t * data = dataArray[2];
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* copy data out of dataArray */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103134/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_badSink(long param_1)
{
func_0x00400cf0(*(undefined8 *)(param_1 + 0x10));
return;
}
|
['gcc']
|
2,383
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_goodG2BSink(wchar_t * dataArray[])
{
wchar_t * data = dataArray[2];
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103134/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_66b_goodG2BSink(long param_1)
{
func_0x00400a90(*(undefined8 *)(param_1 + 0x10));
return;
}
|
['gcc']
|
2,384
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_bad()
{
wchar_t * data;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_structType myStruct;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myStruct.structFirst = data;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_badSink(myStruct);
}
|
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103135/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_438;
undefined2 uStack_436;
undefined4 uStack_434;
undefined8 uStack_428;
undefined8 uStack_420;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 auStack_408 [122];
undefined8 *puStack_38;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_428 = 0x4100000050;
uStack_420 = 0x4800000054;
uStack_418 = 0x3d;
uStack_410 = 0;
puVar3 = auStack_408;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_428;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_438,0,0x10);
uStack_438 = 2;
uStack_434 = func_0x00400d00(&UNK_00401604);
uStack_436 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_438,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
puStack_38 = puStack_10;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_badSink(puStack_10);
return;
}
|
['gcc']
|
2,385
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103135/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,386
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_badSink(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103135/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_badSink(undefined8 param_1)
{
func_0x00400cf0(param_1);
return;
}
|
['gcc']
|
2,387
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_goodG2BSink(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103135/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_67b_goodG2BSink
(undefined8 param_1)
{
func_0x00400a90(param_1);
return;
}
|
['gcc']
|
2,388
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
wchar_t *replace;
SOCKET connectSocket = 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 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 */
/* Abort on error or the connection was closed */
recvResult = recv(connectSocket, (char *)(data + dataLen), sizeof(wchar_t) * (250 - 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 (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_badData = data;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_badSink();
}
|
['/* 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 */', '/* Abort on error or the connection was closed */', '/* Append null terminator */', '/* Eliminate CRLF */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103136/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_bad(void)
{
int iVar1;
long lVar2;
undefined8 *puVar3;
undefined2 uStack_428;
undefined2 uStack_426;
undefined4 uStack_424;
undefined8 uStack_418;
undefined8 uStack_410;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 auStack_3f8 [121];
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined8 *puStack_10;
uStack_418 = 0x4100000050;
uStack_410 = 0x4800000054;
uStack_408 = 0x3d;
uStack_400 = 0;
puVar3 = auStack_3f8;
for (lVar2 = 0x79; lVar2 != 0; lVar2 = lVar2 + -1) {
*puVar3 = 0;
puVar3 = puVar3 + 1;
}
puStack_10 = &uStack_418;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400c90(puStack_10);
iStack_14 = func_0x00400d90(2,1,6);
if (iStack_14 != -1) {
func_0x00400ca0(&uStack_428,0,0x10);
uStack_428 = 2;
uStack_424 = func_0x00400d00(&UNK_00401604);
uStack_426 = func_0x00400c70(0x6987);
iVar1 = func_0x00400d60(iStack_14,&uStack_428,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c40(iStack_14,lStack_20 * 4 + (long)puStack_10,
(0xf9 - lStack_20) * 4,0), iStack_24 != -1)) &&
(iStack_24 != 0)) {
*(undefined4 *)((long)puStack_10 + (lStack_20 + ((ulong)(long)iStack_24 >> 2)) * 4) = 0;
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,0xd);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined4 *)func_0x00400d50(puStack_10,10);
if (puStack_30 != (undefined4 *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400cb0(iStack_14);
}
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_badData = puStack_10;
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_badSink();
return;
}
|
['gcc']
|
2,389
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_good()
{
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103136/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68a.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_good(void)
{
goodG2B();
return;
}
|
['gcc']
|
2,390
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_badSink()
{
wchar_t * data = CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_badData;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103136/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_badSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_badSink(void)
{
func_0x00400cf0(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_badData);
return;
}
|
['gcc']
|
2,391
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_goodG2BSink()
{
wchar_t * data = CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_goodG2BData;
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103136/CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_goodG2BSink
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68b_goodG2BSink(void)
{
func_0x00400a90(CWE427_Uncontrolled_Search_Path_Element__wchar_t_connect_socket_68_goodG2BData);
return;
}
|
['gcc']
|
2,392
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(1)
{
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (250-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(250-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103145/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 auStack_3e8 [122];
long lStack_18;
undefined8 *puStack_10;
uStack_408 = 0x4100000050;
uStack_400 = 0x4800000054;
uStack_3f8 = 0x3d;
uStack_3f0 = 0;
puVar2 = auStack_3e8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_408;
lStack_18 = func_0x00400ad0(puStack_10);
if (1 < 0xfaU - lStack_18) {
lVar1 = func_0x00400a90(lStack_18 * 4 + (long)puStack_10,0xfa - (int)lStack_18,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401314);
*(undefined4 *)((long)puStack_10 + lStack_18 * 4) = 0;
}
else {
lStack_18 = func_0x00400ad0(puStack_10);
if ((lStack_18 != 0) && (*(int *)((long)puStack_10 + lStack_18 * 4 + -4) == 10)) {
*(undefined4 *)((long)puStack_10 + lStack_18 * 4 + -4) = 0;
}
}
}
func_0x00400b10(puStack_10);
return;
}
|
['gcc']
|
2,393
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103145/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_02_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,394
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(5==5)
{
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (250-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(250-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103146/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 auStack_3e8 [122];
long lStack_18;
undefined8 *puStack_10;
uStack_408 = 0x4100000050;
uStack_400 = 0x4800000054;
uStack_3f8 = 0x3d;
uStack_3f0 = 0;
puVar2 = auStack_3e8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_408;
lStack_18 = func_0x00400ad0(puStack_10);
if (1 < 0xfaU - lStack_18) {
lVar1 = func_0x00400a90(lStack_18 * 4 + (long)puStack_10,0xfa - (int)lStack_18,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401314);
*(undefined4 *)((long)puStack_10 + lStack_18 * 4) = 0;
}
else {
lStack_18 = func_0x00400ad0(puStack_10);
if ((lStack_18 != 0) && (*(int *)((long)puStack_10 + lStack_18 * 4 + -4) == 10)) {
*(undefined4 *)((long)puStack_10 + lStack_18 * 4 + -4) = 0;
}
}
}
func_0x00400b10(puStack_10);
return;
}
|
['gcc']
|
2,395
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103146/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_03_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,396
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(STATIC_CONST_TRUE)
{
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (250-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(250-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103147/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 auStack_3e8 [122];
long lStack_18;
undefined8 *puStack_10;
uStack_408 = 0x4100000050;
uStack_400 = 0x4800000054;
uStack_3f8 = 0x3d;
uStack_3f0 = 0;
puVar2 = auStack_3e8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_408;
lStack_18 = func_0x00400ad0(puStack_10);
if (1 < 0xfaU - lStack_18) {
lVar1 = func_0x00400a90(lStack_18 * 4 + (long)puStack_10,0xfa - (int)lStack_18,stdin);
if (lVar1 == 0) {
printLine(&UNK_0040132c);
*(undefined4 *)((long)puStack_10 + lStack_18 * 4) = 0;
}
else {
lStack_18 = func_0x00400ad0(puStack_10);
if ((lStack_18 != 0) && (*(int *)((long)puStack_10 + lStack_18 * 4 + -4) == 10)) {
*(undefined4 *)((long)puStack_10 + lStack_18 * 4 + -4) = 0;
}
}
}
func_0x00400b10(puStack_10);
return;
}
|
['gcc']
|
2,397
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103147/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_04_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
2,398
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05_bad()
{
wchar_t * data;
wchar_t dataBuffer[250] = L"PATH=";
data = dataBuffer;
if(staticTrue)
{
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (250-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(250-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
}
/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */
PUTENV(data);
}
|
['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', '/* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */']
|
['CWE427']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103148/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05_bad
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05_bad(void)
{
long lVar1;
undefined8 *puVar2;
undefined8 uStack_408;
undefined8 uStack_400;
undefined8 uStack_3f8;
undefined8 uStack_3f0;
undefined8 auStack_3e8 [122];
long lStack_18;
undefined8 *puStack_10;
uStack_408 = 0x4100000050;
uStack_400 = 0x4800000054;
uStack_3f8 = 0x3d;
uStack_3f0 = 0;
puVar2 = auStack_3e8;
for (lVar1 = 0x79; lVar1 != 0; lVar1 = lVar1 + -1) {
*puVar2 = 0;
puVar2 = puVar2 + 1;
}
puStack_10 = &uStack_408;
if (staticTrue != 0) {
lStack_18 = func_0x00400ad0(puStack_10);
if (1 < 0xfaU - lStack_18) {
lVar1 = func_0x00400a90(lStack_18 * 4 + (long)puStack_10,0xfa - (int)lStack_18,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401324);
*(undefined4 *)((long)puStack_10 + lStack_18 * 4) = 0;
}
else {
lStack_18 = func_0x00400ad0(puStack_10);
if ((lStack_18 != 0) && (*(int *)((long)puStack_10 + lStack_18 * 4 + -4) == 10)) {
*(undefined4 *)((long)puStack_10 + lStack_18 * 4 + -4) = 0;
}
}
}
}
func_0x00400b10(puStack_10);
return;
}
|
['gcc']
|
2,399
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05_good()
{
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/103148/CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05.c
|
CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05_good
|
void CWE427_Uncontrolled_Search_Path_Element__wchar_t_console_05_good(void)
{
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.