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 |
|---|---|---|---|---|---|---|---|---|
10,200 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_44_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112834/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_44_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_44_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,201 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112835/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401635);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_badData = puStack_10;
badSink();
return;
}
| ['gcc'] |
10,202 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112835/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_45_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,203 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112836/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401614);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_badSink(puStack_10);
return;
}
| ['gcc'] |
10,204 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112836/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,205 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112836/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400ef6:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401614);
goto code_r0x00400ef6;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,206 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112836/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_51b_goodB2GSink
(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400ce0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f15:
func_0x00400c80(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401644);
goto code_r0x00400f15;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,207 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112837/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401634);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_badSink(puStack_10);
return;
}
| ['gcc'] |
10,208 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112837/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,209 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112837/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_badSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_badSink(param_1);
return;
}
| ['gcc'] |
10,210 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112837/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,211 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112837/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400ef6:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401634);
goto code_r0x00400ef6;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,212 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112837/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_52c_goodB2GSink
(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400ce0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f15:
func_0x00400c80(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401664);
goto code_r0x00400f15;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,213 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401644);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_badSink(puStack_10);
return;
}
| ['gcc'] |
10,214 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,215 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_badSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_badSink(param_1);
return;
}
| ['gcc'] |
10,216 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,217 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_badSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_badSink(param_1);
return;
}
| ['gcc'] |
10,218 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53c_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,219 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400ef6:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401644);
goto code_r0x00400ef6;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,220 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112838/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_53d_goodB2GSink
(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400ce0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f15:
func_0x00400c80(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401674);
goto code_r0x00400f15;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,221 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401664);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_badSink(puStack_10);
return;
}
| ['gcc'] |
10,222 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,223 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_badSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_badSink(param_1);
return;
}
| ['gcc'] |
10,224 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,225 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_badSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_badSink(param_1);
return;
}
| ['gcc'] |
10,226 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54c_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,227 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_badSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_badSink(param_1);
return;
}
| ['gcc'] |
10,228 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54d_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,229 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400ef6:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401664);
goto code_r0x00400ef6;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,230 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112839/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_54e_goodB2GSink
(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400ce0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f15:
func_0x00400c80(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401694);
goto code_r0x00400f15;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,231 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b_badSource(data);
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112840/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61_bad(void)
{
undefined4 *puVar1;
int *piStack_10;
puVar1 = (undefined4 *)func_0x00400d70(400);
*puVar1 = 0;
piStack_10 = (int *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b_badSource
(puVar1);
do {
if (*piStack_10 == 0) {
code_r0x00400f1a:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401614);
goto code_r0x00400f1a;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,232 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112840/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,233 | wchar_t * CWE761_Free_Pointer_Not_at_Start_of_Buffer__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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112840/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b_badSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__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_0x00400ce0(param_1);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400cf0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400d40(&UNK_00401614);
uStack_36 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c90(iStack_c,lStack_18 * 4 + param_1,(99 - lStack_18) * 4,0),
iStack_1c != -1)) && (iStack_1c != 0)) {
*(undefined4 *)(param_1 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0;
puStack_28 = (undefined4 *)func_0x00400da0(param_1,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400da0(param_1,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d00(iStack_c);
}
return param_1;
}
| ['gcc'] |
10,234 | wchar_t * CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b_goodB2GSource(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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (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 */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112840/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b_goodB2GSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_61b_goodB2GSource
(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_0x00400ce0(param_1);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400cf0(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400d40(&UNK_00401644);
uStack_36 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c90(iStack_c,lStack_18 * 4 + param_1,(99 - lStack_18) * 4,0),
iStack_1c != -1)) && (iStack_1c != 0)) {
*(undefined4 *)(param_1 + (lStack_18 + ((ulong)(long)iStack_1c >> 2)) * 4) = 0;
puStack_28 = (undefined4 *)func_0x00400da0(param_1,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400da0(param_1,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d00(iStack_c);
}
return param_1;
}
| ['gcc'] |
10,235 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112842/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
undefined4 *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
puStack_30 = (undefined4 *)func_0x00400d70(400);
*puStack_30 = 0;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400ce0(puStack_30);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401614);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_c,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c90(iStack_c,puStack_30 + lStack_18,(99 - lStack_18) * 4,0),
iStack_1c != -1)) && (iStack_1c != 0)) {
puStack_30[lStack_18 + ((ulong)(long)iStack_1c >> 2)] = 0;
puStack_28 = (undefined4 *)func_0x00400da0(puStack_30,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400da0(puStack_30,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d00(iStack_c);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_badSink(&puStack_30);
return;
}
| ['gcc'] |
10,236 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112842/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,237 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_badSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112842/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_badSink(int **param_1)
{
int *piStack_10;
piStack_10 = *param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400f01:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401614);
goto code_r0x00400f01;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,238 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_goodB2GSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112842/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_63b_goodB2GSink
(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400ce0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f20:
func_0x00400c80(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401644);
goto code_r0x00400f20;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,239 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112843/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
undefined4 *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
puStack_30 = (undefined4 *)func_0x00400d70(400);
*puStack_30 = 0;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400ce0(puStack_30);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401614);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_c,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c90(iStack_c,puStack_30 + lStack_18,(99 - lStack_18) * 4,0),
iStack_1c != -1)) && (iStack_1c != 0)) {
puStack_30[lStack_18 + ((ulong)(long)iStack_1c >> 2)] = 0;
puStack_28 = (undefined4 *)func_0x00400da0(puStack_30,0xd);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined4 *)func_0x00400da0(puStack_30,10);
if (puStack_28 != (undefined4 *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d00(iStack_c);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b_badSink(&puStack_30);
return;
}
| ['gcc'] |
10,240 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112843/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,241 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__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);
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112843/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b_badSink(int **param_1)
{
int *piStack_10;
piStack_10 = *param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400f09:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401614);
goto code_r0x00400f09;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,242 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b_goodB2GSink(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);
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112843/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_64b_goodB2GSink
(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400ce0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f28:
func_0x00400c80(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401644);
goto code_r0x00400f28;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,243 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65_bad()
{
wchar_t * data;
/* define a function pointer */
void (*funcPtr) (wchar_t *) = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_badSink;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112844/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined4 *puStack_18;
code *pcStack_10;
pcStack_10 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_badSink;
puStack_18 = (undefined4 *)func_0x00400d70(400);
*puStack_18 = 0;
iStack_1c = 0xffffffff;
lStack_28 = func_0x00400ce0(puStack_18);
iStack_1c = func_0x00400de0(2,1,6);
if (iStack_1c != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401614);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_1c,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_2c = func_0x00400c90(iStack_1c,puStack_18 + lStack_28,(99 - lStack_28) * 4,0),
iStack_2c != -1)) && (iStack_2c != 0)) {
puStack_18[lStack_28 + ((ulong)(long)iStack_2c >> 2)] = 0;
puStack_38 = (undefined4 *)func_0x00400da0(puStack_18,0xd);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined4 *)func_0x00400da0(puStack_18,10);
if (puStack_38 != (undefined4 *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d00(iStack_1c);
}
(*pcStack_10)(puStack_18);
return;
}
| ['gcc'] |
10,244 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112844/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,245 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112844/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400ef6:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401614);
goto code_r0x00400ef6;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,246 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112844/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_65b_goodB2GSink
(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400ce0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f15:
func_0x00400c80(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401644);
goto code_r0x00400f15;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,247 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66_bad()
{
wchar_t * data;
wchar_t * dataArray[5];
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
/* put data in array */
dataArray[2] = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112845/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66_bad(void)
{
int iVar1;
undefined2 uStack_68;
undefined2 uStack_66;
undefined4 uStack_64;
undefined auStack_58 [16];
undefined4 *puStack_48;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_68,0,0x10);
uStack_68 = 2;
uStack_64 = func_0x00400d40(&UNK_00401624);
uStack_66 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_68,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
puStack_48 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_badSink(auStack_58);
return;
}
| ['gcc'] |
10,248 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112845/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,249 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_badSink(wchar_t * dataArray[])
{
/* copy data out of dataArray */
wchar_t * data = dataArray[2];
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* copy data out of dataArray */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112845/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_badSink(long param_1)
{
int *piStack_10;
piStack_10 = *(int **)(param_1 + 0x10);
do {
if (*piStack_10 == 0) {
code_r0x00400f02:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401624);
goto code_r0x00400f02;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,250 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_goodB2GSink(wchar_t * dataArray[])
{
wchar_t * data = dataArray[2];
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112845/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_66b_goodB2GSink
(long param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *(long *)(param_1 + 0x10);
uStack_10 = 0;
do {
uVar2 = func_0x00400ce0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f21:
func_0x00400c80(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401654);
goto code_r0x00400f21;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,251 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_bad()
{
wchar_t * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_structType myStruct;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
myStruct.structFirst = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112846/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_38;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401624);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
puStack_38 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_badSink(puStack_10);
return;
}
| ['gcc'] |
10,252 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112846/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,253 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112846/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400efe:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401624);
goto code_r0x00400efe;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,254 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112846/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_67b_goodB2GSink
(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400ce0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f1d:
func_0x00400c80(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401654);
goto code_r0x00400f1d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,255 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
#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) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(wchar_t)] = L'\0';
/* Eliminate CRLF */
replace = wcschr(data, L'\r');
if (replace)
{
*replace = L'\0';
}
replace = wcschr(data, L'\n');
if (replace)
{
*replace = L'\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_badDataForBadSink = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112847/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined4 *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400d70(400);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400ce0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400cf0(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d40(&UNK_00401624);
uStack_46 = func_0x00400cc0(0x6987);
iVar1 = func_0x00400db0(iStack_14,&uStack_48,0x10);
if (((iVar1 != -1) &&
(iStack_24 = func_0x00400c90(iStack_14,puStack_10 + lStack_20,(99 - lStack_20) * 4,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[lStack_20 + ((ulong)(long)iStack_24 >> 2)] = 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);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_badDataForBadSink =
puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_badSink();
return;
}
| ['gcc'] |
10,256 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112847/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,257 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_badSink()
{
wchar_t * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_badDataForBadSink;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112847/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_badSink(void)
{
int *piStack_10;
piStack_10 =
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_badDataForBadSink;
do {
if (*piStack_10 == 0) {
code_r0x00400efd:
func_0x00400c80(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401624);
goto code_r0x00400efd;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,258 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_goodB2GSink()
{
wchar_t * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_badDataForGoodSink;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112847/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68b_goodB2GSink(void)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_connect_socket_68_badDataForGoodSink;
uStack_10 = 0;
do {
uVar2 = func_0x00400ce0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f1c:
func_0x00400c80(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401654);
goto code_r0x00400f1c;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,259 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112855/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400df5:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
goto code_r0x00400df5;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,260 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112855/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_01_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,261 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(1)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112856/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400df5:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
goto code_r0x00400df5;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,262 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112856/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_02_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,263 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(5==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112857/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400df5:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
goto code_r0x00400df5;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,264 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112857/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_03_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,265 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(STATIC_CONST_TRUE)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112858/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_0040138c);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400dfe:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_0040139c);
goto code_r0x00400dfe;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,266 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112858/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_04_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,267 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(staticTrue)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112859/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
if (staticTrue != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,268 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112859/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_05_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,269 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(GLOBAL_CONST_TRUE)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112863/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
if (GLOBAL_CONST_TRUE != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,270 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112863/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_09_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,271 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(globalTrue)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112864/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
if (globalTrue != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,272 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112864/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_10_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,273 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(globalReturnsTrue())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112865/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar2 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(piStack_10 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(piStack_10);
if ((lVar2 != 0) && (piStack_10[lVar2 + -1] == 10)) {
piStack_10[lVar2 + -1] = 0;
}
}
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,274 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112865/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_11_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,275 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(globalReturnsTrueOrFalse())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
else
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112866/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uVar4;
ulong uStack_18;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar2 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(piStack_10 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013e4);
piStack_10[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(piStack_10);
if ((lVar2 != 0) && (piStack_10[lVar2 + -1] == 10)) {
piStack_10[lVar2 + -1] = 0;
}
}
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
for (uStack_18 = 0; uVar4 = func_0x00400b60(piStack_10), uStack_18 < uVar4;
uStack_18 = uStack_18 + 1) {
if (piStack_10[uStack_18] == 0x53) {
printLine(&UNK_004013f4);
break;
}
}
func_0x00400b10(piStack_10);
}
else {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013f4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,276 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112866/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_12_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,277 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
if(globalFive==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112868/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
if (globalFive == 5) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,278 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112868/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_14_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,279 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
switch(6)
{
case 6:
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* 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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112869/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400df5:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
goto code_r0x00400df5;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,280 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112869/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_15_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,281 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
while(1)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
break;
}
} | ['/* 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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112870/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400df5:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
goto code_r0x00400df5;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,282 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112870/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_16_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,283 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17_bad()
{
int j;
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
for(j = 0; j < 1; j++)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112871/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17_bad(void)
{
long lVar1;
long lVar2;
int *piStack_18;
int iStack_c;
piStack_18 = (int *)func_0x00400bc0(400);
*piStack_18 = 0;
lVar1 = func_0x00400b60(piStack_18);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_18 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_18[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_18);
if ((lVar1 != 0) && (piStack_18[lVar1 + -1] == 10)) {
piStack_18[lVar1 + -1] = 0;
}
}
}
iStack_c = 0;
do {
if (0 < iStack_c) {
return;
}
for (; *piStack_18 != 0; piStack_18 = piStack_18 + 1) {
if (*piStack_18 == 0x53) {
printLine(&UNK_004013a4);
break;
}
}
func_0x00400b10(piStack_18);
iStack_c = iStack_c + 1;
} while( true );
}
| ['gcc'] |
10,284 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112871/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_17_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,285 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
goto sink;
sink:
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112872/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400df6:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
goto code_r0x00400df6;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,286 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112872/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_18_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,287 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
badStatic = 1; /* true */
badSink(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 */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112873/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013c5);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
badStatic = 1;
badSink(puVar1);
return;
}
| ['gcc'] |
10,288 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112873/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_21_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,289 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badGlobal = 1; /* true */
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badSink(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 */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112874/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013b4);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badGlobal = 1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badSink(puVar1);
return;
}
| ['gcc'] |
10,290 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112874/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,291 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badSink(wchar_t * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badGlobal)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112874/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_badGlobal != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_004013b4);
break;
}
}
func_0x00400b10(piStack_10);
}
return;
}
| ['gcc'] |
10,292 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G1Sink(wchar_t * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112874/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G1Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G1Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G1Global == 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) break;
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401579);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b10(param_1);
}
else {
printLine(&UNK_00401564);
}
return;
}
| ['gcc'] |
10,293 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G2Sink(wchar_t * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G2Global)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112874/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G2Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G2Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_22_goodB2G2Global != 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) break;
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401579);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b10(param_1);
}
return;
}
| ['gcc'] |
10,294 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
{
wchar_t * dataCopy = data;
wchar_t * data = dataCopy;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112875/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400e05:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
goto code_r0x00400e05;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,295 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112875/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_31_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,296 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32_bad()
{
wchar_t * data;
wchar_t * *dataPtr1 = &data;
wchar_t * *dataPtr2 = &data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
wchar_t * data = *dataPtr1;
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
*dataPtr1 = data;
}
{
wchar_t * data = *dataPtr2;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112876/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32_bad(void)
{
long lVar1;
int *piStack_38;
long lStack_30;
int *piStack_28;
int **ppiStack_20;
int **ppiStack_18;
int *piStack_10;
ppiStack_18 = &piStack_38;
ppiStack_20 = &piStack_38;
piStack_38 = (int *)func_0x00400bc0(400);
*piStack_38 = 0;
piStack_28 = *ppiStack_18;
lStack_30 = func_0x00400b60(piStack_28);
if (1 < 100U - lStack_30) {
lVar1 = func_0x00400b20(piStack_28 + lStack_30,100 - (int)lStack_30,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013b4);
piStack_28[lStack_30] = 0;
}
else {
lStack_30 = func_0x00400b60(piStack_28);
if ((lStack_30 != 0) && (piStack_28[lStack_30 + -1] == 10)) {
piStack_28[lStack_30 + -1] = 0;
}
}
}
*ppiStack_18 = piStack_28;
piStack_10 = *ppiStack_20;
do {
if (*piStack_10 == 0) {
code_r0x00400e26:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013c4);
goto code_r0x00400e26;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,297 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112876/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_32_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,298 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_bad()
{
wchar_t * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_unionType myUnion;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-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';
}
}
}
myUnion.unionFirst = data;
{
wchar_t * data = myUnion.unionSecond;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(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 */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112878/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bc0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b60(piStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(piStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401394);
piStack_10[lVar1] = 0;
}
else {
lVar1 = func_0x00400b60(piStack_10);
if ((lVar1 != 0) && (piStack_10[lVar1 + -1] == 10)) {
piStack_10[lVar1 + -1] = 0;
}
}
}
do {
if (*piStack_10 == 0) {
code_r0x00400e05:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
goto code_r0x00400e05;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,299 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112878/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_34_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.