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 |
|---|---|---|---|---|---|---|---|---|
9,600 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_41_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112543/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_41_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_41_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,601 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
data = 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 != '\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/112544/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400d80(100);
*puVar1 = 0;
pcStack_10 = (char *)badSource(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00401061:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015fe);
goto code_r0x00401061;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,602 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112544/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_42_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,603 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44_bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = badSink;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\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/112546/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined *puStack_18;
code *pcStack_10;
pcStack_10 = badSink;
puStack_18 = (undefined *)func_0x00400d80(100);
*puStack_18 = 0;
iStack_1c = 0xffffffff;
lStack_28 = func_0x00400cc0(puStack_18);
iStack_1c = func_0x00400de0(2,1,6);
if (iStack_1c != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_00401605);
uStack_46 = func_0x00400cd0(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,0),
iStack_2c != -1)) && (iStack_2c != 0)) {
puStack_18[iStack_2c + lStack_28] = 0;
puStack_38 = (undefined *)func_0x00400ce0(puStack_18,0xd);
if (puStack_38 != (undefined *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined *)func_0x00400ce0(puStack_18,10);
if (puStack_38 != (undefined *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d10(iStack_1c);
}
(*pcStack_10)(puStack_18);
return;
}
| ['gcc'] |
9,604 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112546/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_44_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,605 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112547/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_00401605);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_badData = puStack_10;
badSink();
return;
}
| ['gcc'] |
9,606 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112547/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_45_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,607 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112548/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_004015e4);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_badSink(puStack_10);
return;
}
| ['gcc'] |
9,608 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112548/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,609 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_badSink(char * 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 != '\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/112548/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400ef7:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015e4);
goto code_r0x00400ef7;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,610 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_goodB2GSink(char * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112548/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_51b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400cc0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f0d:
func_0x00400c80(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401614);
goto code_r0x00400f0d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,611 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112549/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_00401604);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_badSink(puStack_10);
return;
}
| ['gcc'] |
9,612 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112549/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,613 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112549/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_badSink(param_1);
return;
}
| ['gcc'] |
9,614 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112549/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,615 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_badSink(char * 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 != '\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/112549/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400ef7:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401604);
goto code_r0x00400ef7;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,616 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_goodB2GSink(char * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112549/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_52c_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400cc0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f0d:
func_0x00400c80(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401624);
goto code_r0x00400f0d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,617 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_00401624);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_badSink(puStack_10);
return;
}
| ['gcc'] |
9,618 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,619 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_badSink(param_1);
return;
}
| ['gcc'] |
9,620 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,621 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_badSink(param_1);
return;
}
| ['gcc'] |
9,622 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53c_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,623 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_badSink(char * 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 != '\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/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400ef7:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401624);
goto code_r0x00400ef7;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,624 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_goodB2GSink(char * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112550/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_53d_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400cc0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f0d:
func_0x00400c80(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401644);
goto code_r0x00400f0d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,625 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_00401634);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_badSink(puStack_10);
return;
}
| ['gcc'] |
9,626 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,627 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_badSink(param_1);
return;
}
| ['gcc'] |
9,628 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,629 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_badSink(param_1);
return;
}
| ['gcc'] |
9,630 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54c_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,631 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_badSink(param_1);
return;
}
| ['gcc'] |
9,632 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54d_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,633 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_badSink(char * 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 != '\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/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400ef7:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401634);
goto code_r0x00400ef7;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,634 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_goodB2GSink(char * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112551/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_54e_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400cc0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f0d:
func_0x00400c80(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401664);
goto code_r0x00400f0d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,635 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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 != '\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/112552/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400d80(100);
*puVar1 = 0;
pcStack_10 = (char *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_badSource
(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400f18:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400f18;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,636 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112552/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,637 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_badSource(char * data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\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/112552/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_badSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_badSource(long param_1)
{
int iVar1;
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400cc0(param_1);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400d00(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400d50(&UNK_004015f4);
uStack_36 = func_0x00400cd0(0x6987);
iVar1 = func_0x00400db0(iStack_c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c90(iStack_c,param_1 + lStack_18,99 - lStack_18,0), iStack_1c != -1
)) && (iStack_1c != 0)) {
*(undefined *)(param_1 + iStack_1c + lStack_18) = 0;
puStack_28 = (undefined *)func_0x00400ce0(param_1,0xd);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined *)func_0x00400ce0(param_1,10);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d10(iStack_c);
}
return param_1;
}
| ['gcc'] |
9,638 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_goodB2GSource(char * data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\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/112552/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_goodB2GSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_61b_goodB2GSource(long param_1)
{
int iVar1;
undefined2 uStack_38;
undefined2 uStack_36;
undefined4 uStack_34;
undefined *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400cc0(param_1);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400d00(&uStack_38,0,0x10);
uStack_38 = 2;
uStack_34 = func_0x00400d50(&UNK_00401614);
uStack_36 = func_0x00400cd0(0x6987);
iVar1 = func_0x00400db0(iStack_c,&uStack_38,0x10);
if (((iVar1 != -1) &&
(iStack_1c = func_0x00400c90(iStack_c,param_1 + lStack_18,99 - lStack_18,0), iStack_1c != -1
)) && (iStack_1c != 0)) {
*(undefined *)(param_1 + iStack_1c + lStack_18) = 0;
puStack_28 = (undefined *)func_0x00400ce0(param_1,0xd);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined *)func_0x00400ce0(param_1,10);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d10(iStack_c);
}
return param_1;
}
| ['gcc'] |
9,639 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112554/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
undefined *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
puStack_30 = (undefined *)func_0x00400d80(100);
*puStack_30 = 0;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400cc0(puStack_30);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_004015f4);
uStack_46 = func_0x00400cd0(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,0),
iStack_1c != -1)) && (iStack_1c != 0)) {
puStack_30[lStack_18 + iStack_1c] = 0;
puStack_28 = (undefined *)func_0x00400ce0(puStack_30,0xd);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined *)func_0x00400ce0(puStack_30,10);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d10(iStack_c);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_badSink(&puStack_30);
return;
}
| ['gcc'] |
9,640 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112554/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,641 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_badSink(char * * dataPtr)
{
char * 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 != '\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/112554/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400f02:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400f02;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,642 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_goodB2GSink(char * * dataPtr)
{
char * data = *dataPtr;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112554/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_63b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400cc0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f18:
func_0x00400c80(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401614);
goto code_r0x00400f18;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,643 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112555/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
undefined *puStack_28;
int iStack_1c;
long lStack_18;
int iStack_c;
puStack_30 = (undefined *)func_0x00400d80(100);
*puStack_30 = 0;
iStack_c = 0xffffffff;
lStack_18 = func_0x00400cc0(puStack_30);
iStack_c = func_0x00400de0(2,1,6);
if (iStack_c != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_004015f4);
uStack_46 = func_0x00400cd0(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,0),
iStack_1c != -1)) && (iStack_1c != 0)) {
puStack_30[lStack_18 + iStack_1c] = 0;
puStack_28 = (undefined *)func_0x00400ce0(puStack_30,0xd);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
puStack_28 = (undefined *)func_0x00400ce0(puStack_30,10);
if (puStack_28 != (undefined *)0x0) {
*puStack_28 = 0;
}
}
}
if (iStack_c != -1) {
func_0x00400d10(iStack_c);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_badSink(&puStack_30);
return;
}
| ['gcc'] |
9,644 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112555/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,645 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
char * * dataPtr = (char * *)dataVoidPtr;
/* dereference dataPtr into data */
char * 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 != '\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/112555/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400f0a:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400f0a;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,646 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_goodB2GSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
char * * dataPtr = (char * *)dataVoidPtr;
/* dereference dataPtr into data */
char * data = (*dataPtr);
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112555/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_64b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400cc0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f20:
func_0x00400c80(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401624);
goto code_r0x00400f20;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,647 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65_bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_badSink;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\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/112556/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_38;
int iStack_2c;
long lStack_28;
int iStack_1c;
undefined *puStack_18;
code *pcStack_10;
pcStack_10 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_badSink;
puStack_18 = (undefined *)func_0x00400d80(100);
*puStack_18 = 0;
iStack_1c = 0xffffffff;
lStack_28 = func_0x00400cc0(puStack_18);
iStack_1c = func_0x00400de0(2,1,6);
if (iStack_1c != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_004015f4);
uStack_46 = func_0x00400cd0(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,0),
iStack_2c != -1)) && (iStack_2c != 0)) {
puStack_18[iStack_2c + lStack_28] = 0;
puStack_38 = (undefined *)func_0x00400ce0(puStack_18,0xd);
if (puStack_38 != (undefined *)0x0) {
*puStack_38 = 0;
}
puStack_38 = (undefined *)func_0x00400ce0(puStack_18,10);
if (puStack_38 != (undefined *)0x0) {
*puStack_38 = 0;
}
}
}
if (iStack_1c != -1) {
func_0x00400d10(iStack_1c);
}
(*pcStack_10)(puStack_18);
return;
}
| ['gcc'] |
9,648 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112556/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,649 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_badSink(char * 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 != '\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/112556/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400ef7:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400ef7;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,650 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_goodB2GSink(char * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112556/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_65b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400cc0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f0d:
func_0x00400c80(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401614);
goto code_r0x00400f0d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,651 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66_bad()
{
char * data;
char * dataArray[5];
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\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__char_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/112557/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66_bad(void)
{
int iVar1;
undefined2 uStack_68;
undefined2 uStack_66;
undefined4 uStack_64;
undefined auStack_58 [16];
undefined *puStack_48;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_68,0,0x10);
uStack_68 = 2;
uStack_64 = func_0x00400d50(&UNK_004015f4);
uStack_66 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
puStack_48 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b_badSink(auStack_58);
return;
}
| ['gcc'] |
9,652 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112557/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,653 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b_badSink(char * dataArray[])
{
/* copy data out of dataArray */
char * 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 != '\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/112557/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b_badSink(long param_1)
{
char *pcStack_10;
pcStack_10 = *(char **)(param_1 + 0x10);
do {
if (*pcStack_10 == '\0') {
code_r0x00400f03:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400f03;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,654 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b_goodB2GSink(char * dataArray[])
{
char * data = dataArray[2];
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112557/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_66b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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_0x00400cc0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f19:
func_0x00400c80(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401624);
goto code_r0x00400f19;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,655 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_structType myStruct;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\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__char_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/112558/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_38;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_004015f4);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
puStack_38 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_badSink(puStack_10);
return;
}
| ['gcc'] |
9,656 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112558/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,657 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_structType myStruct)
{
char * 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 != '\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/112558/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400eff:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400eff;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,658 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67_structType myStruct)
{
char * data = myStruct.structFirst;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112558/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_67b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400cc0(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400f15:
func_0x00400c80(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401624);
goto code_r0x00400f15;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,659 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
char *replace;
SOCKET connectSocket = INVALID_SOCKET;
size_t dataLen = strlen(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(char) * (100 - dataLen - 1), 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* Append null terminator */
data[dataLen + recvResult / sizeof(char)] = '\0';
/* Eliminate CRLF */
replace = strchr(data, '\r');
if (replace)
{
*replace = '\0';
}
replace = strchr(data, '\n');
if (replace)
{
*replace = '\0';
}
}
while (0);
if (connectSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(connectSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_badDataForBadSink = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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/112559/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_bad(void)
{
int iVar1;
undefined2 uStack_48;
undefined2 uStack_46;
undefined4 uStack_44;
undefined *puStack_30;
int iStack_24;
long lStack_20;
int iStack_14;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400d80(100);
*puStack_10 = 0;
iStack_14 = 0xffffffff;
lStack_20 = func_0x00400cc0(puStack_10);
iStack_14 = func_0x00400de0(2,1,6);
if (iStack_14 != -1) {
func_0x00400d00(&uStack_48,0,0x10);
uStack_48 = 2;
uStack_44 = func_0x00400d50(&UNK_004015f4);
uStack_46 = func_0x00400cd0(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,0),
iStack_24 != -1)) && (iStack_24 != 0)) {
puStack_10[iStack_24 + lStack_20] = 0;
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,0xd);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
puStack_30 = (undefined *)func_0x00400ce0(puStack_10,10);
if (puStack_30 != (undefined *)0x0) {
*puStack_30 = 0;
}
}
}
if (iStack_14 != -1) {
func_0x00400d10(iStack_14);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_badDataForBadSink = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_badSink();
return;
}
| ['gcc'] |
9,660 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112559/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,661 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_badSink()
{
char * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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 != '\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/112559/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_badSink(void)
{
char *pcStack_10;
pcStack_10 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_badDataForBadSink;
do {
if (*pcStack_10 == '\0') {
code_r0x00400efe:
func_0x00400c80(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004015f4);
goto code_r0x00400efe;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,662 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_goodB2GSink()
{
char * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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 < strlen(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/112559/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68b_goodB2GSink(void)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_connect_socket_68_badDataForGoodSink;
uStack_10 = 0;
do {
uVar2 = func_0x00400cc0(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400f14:
func_0x00400c80(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401624);
goto code_r0x00400f14;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,663 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112570/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_0040136c);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400dde:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_0040137b);
goto code_r0x00400dde;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,664 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112570/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_04_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,665 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112571/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
if (staticTrue != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,666 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112571/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_05_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,667 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
if(STATIC_CONST_FIVE==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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112572/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401378);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400ddf:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401387);
goto code_r0x00400ddf;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,668 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112572/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_06_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,669 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
if(staticFive==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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112573/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
if (staticFive == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,670 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112573/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_07_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,671 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
if(staticReturnsTrue())
{
/* 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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112574/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b80(pcStack_10 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_00401384);
pcStack_10[lVar2] = '\0';
}
else {
lVar2 = func_0x00400b40(pcStack_10);
if ((lVar2 != 0) && (pcStack_10[lVar2 + -1] == '\n')) {
pcStack_10[lVar2 + -1] = '\0';
}
}
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401393);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,672 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112574/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_08_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,673 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112575/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
if (GLOBAL_CONST_TRUE != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,674 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112575/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_09_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,675 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112576/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
if (globalTrue != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,676 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112576/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_10_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,677 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112577/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b80(pcStack_10 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar2] = '\0';
}
else {
lVar2 = func_0x00400b40(pcStack_10);
if ((lVar2 != 0) && (pcStack_10[lVar2 + -1] == '\n')) {
pcStack_10[lVar2 + -1] = '\0';
}
}
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,678 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112577/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_11_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,679 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 < strlen(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 fgets() */', '/* Restore NUL terminator if fgets 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/112578/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uVar4;
ulong uStack_18;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b80(pcStack_10 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013c4);
pcStack_10[lVar2] = '\0';
}
else {
lVar2 = func_0x00400b40(pcStack_10);
if ((lVar2 != 0) && (pcStack_10[lVar2 + -1] == '\n')) {
pcStack_10[lVar2 + -1] = '\0';
}
}
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
for (uStack_18 = 0; uVar4 = func_0x00400b40(pcStack_10), uStack_18 < uVar4;
uStack_18 = uStack_18 + 1) {
if (pcStack_10[uStack_18] == 'S') {
printLine(&UNK_004013d3);
break;
}
}
func_0x00400b10(pcStack_10);
}
else {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013d3);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,680 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112578/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_12_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,681 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
if(GLOBAL_CONST_FIVE==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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112579/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
if (GLOBAL_CONST_FIVE == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,682 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112579/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_13_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,683 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112580/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
if (globalFive == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,684 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112580/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_14_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,685 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112581/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401364);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400dd5:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401373);
goto code_r0x00400dd5;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,686 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112581/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_15_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,687 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112582/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401364);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400dd5:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401373);
goto code_r0x00400dd5;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,688 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112582/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_16_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,689 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_bad()
{
int j;
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112583/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_18;
int iStack_c;
pcStack_18 = (char *)func_0x00400bc0(100);
*pcStack_18 = '\0';
lVar1 = func_0x00400b40(pcStack_18);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_18 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401374);
pcStack_18[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_18);
if ((lVar1 != 0) && (pcStack_18[lVar1 + -1] == '\n')) {
pcStack_18[lVar1 + -1] = '\0';
}
}
}
iStack_c = 0;
do {
if (0 < iStack_c) {
return;
}
for (; *pcStack_18 != '\0'; pcStack_18 = pcStack_18 + 1) {
if (*pcStack_18 == 'S') {
printLine(&UNK_00401383);
break;
}
}
func_0x00400b10(pcStack_18);
iStack_c = iStack_c + 1;
} while( true );
}
| ['gcc'] |
9,690 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112583/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_17_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,691 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 != '\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 fgets() */', '/* Restore NUL terminator if fgets 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/112584/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bc0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b40(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(pcStack_10 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401364);
pcStack_10[lVar1] = '\0';
}
else {
lVar1 = func_0x00400b40(pcStack_10);
if ((lVar1 != 0) && (pcStack_10[lVar1 + -1] == '\n')) {
pcStack_10[lVar1 + -1] = '\0';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400dd6:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401373);
goto code_r0x00400dd6;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,692 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112584/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_18_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,693 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\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 fgets() */', '/* Restore NUL terminator if fgets fails */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112585/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bc0(100);
*puVar1 = 0;
lVar2 = func_0x00400b40(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b80(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013a5);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b40(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == '\n')) {
puVar1[lVar2 + -1] = 0;
}
}
}
badStatic = 1;
badSink(puVar1);
return;
}
| ['gcc'] |
9,694 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112585/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_21_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,695 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from the console */
size_t dataLen = strlen(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 (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badGlobal = 1; /* true */
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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 fgets() */', '/* Restore NUL terminator if fgets fails */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112586/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bc0(100);
*puVar1 = 0;
lVar2 = func_0x00400b40(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b80(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_00401394);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b40(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == '\n')) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badGlobal = 1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badSink(puVar1);
return;
}
| ['gcc'] |
9,696 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112586/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,697 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badSink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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 != '\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/112586/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_badGlobal != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401394);
break;
}
}
func_0x00400b10(pcStack_10);
}
return;
}
| ['gcc'] |
9,698 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G1Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_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 < strlen(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/112586/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G1Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G1Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G1Global == 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401529);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b10(param_1);
}
else {
printLine(&UNK_00401514);
}
return;
}
| ['gcc'] |
9,699 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G2Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G2Global)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(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/112586/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G2Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G2Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_22_goodB2G2Global != 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401529);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b10(param_1);
}
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.