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,700 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_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';
}
}
}
{
char * dataCopy = data;
char * data = dataCopy;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\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/112587/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_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';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400de5:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
goto code_r0x00400de5;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,701 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112587/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_31_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,702 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32_bad()
{
char * data;
char * *dataPtr1 = &data;
char * *dataPtr2 = &data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
char * data = *dataPtr1;
{
/* 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';
}
}
}
*dataPtr1 = data;
}
{
char * data = *dataPtr2;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\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/112588/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32_bad(void)
{
long lVar1;
char *pcStack_38;
long lStack_30;
char *pcStack_28;
char **ppcStack_20;
char **ppcStack_18;
char *pcStack_10;
ppcStack_18 = &pcStack_38;
ppcStack_20 = &pcStack_38;
pcStack_38 = (char *)func_0x00400bc0(100);
*pcStack_38 = '\0';
pcStack_28 = *ppcStack_18;
lStack_30 = func_0x00400b40(pcStack_28);
if (1 < 100U - lStack_30) {
lVar1 = func_0x00400b80(pcStack_28 + lStack_30,100 - (int)lStack_30,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401394);
pcStack_28[lStack_30] = '\0';
}
else {
lStack_30 = func_0x00400b40(pcStack_28);
if ((lStack_30 != 0) && (pcStack_28[lStack_30 + -1] == '\n')) {
pcStack_28[lStack_30 + -1] = '\0';
}
}
}
*ppcStack_18 = pcStack_28;
pcStack_10 = *ppcStack_20;
do {
if (*pcStack_10 == '\0') {
code_r0x00400e06:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013a3);
goto code_r0x00400e06;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,703 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112588/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_32_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,704 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_unionType myUnion;
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';
}
}
}
myUnion.unionFirst = data;
{
char * data = myUnion.unionSecond;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\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/112590/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_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';
}
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400de5:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401383);
goto code_r0x00400de5;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,705 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112590/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_34_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,706 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41_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';
}
}
}
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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112591/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41_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_00401395);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b40(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == '\n')) {
puVar1[lVar2 + -1] = 0;
}
}
}
badSink(puVar1);
return;
}
| ['gcc'] |
9,707 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112591/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_41_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,708 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112592/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400bc0(100);
*puVar1 = 0;
pcStack_10 = (char *)badSource(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400df7:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401393);
goto code_r0x00400df7;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,709 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112592/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_42_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,710 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44_bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = badSink;
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';
}
}
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* 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 */', '/* use the function pointer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112594/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44_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_00401395);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b40(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == '\n')) {
puVar1[lVar2 + -1] = 0;
}
}
}
badSink(puVar1);
return;
}
| ['gcc'] |
9,711 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112594/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_44_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,712 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_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_45_badData = data;
badSink();
} | ['/* 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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112595/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_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;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_badData = puVar1;
badSink();
return;
}
| ['gcc'] |
9,713 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112595/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_45_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,714 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51_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_51b_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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112596/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51_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_00401384);
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_51b_badSink(puVar1);
return;
}
| ['gcc'] |
9,715 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112596/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,716 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112596/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d17:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401384);
goto code_r0x00400d17;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,717 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112596/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_51b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d2d:
func_0x00400b10(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013a4);
goto code_r0x00400d2d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,718 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52_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_52b_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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112597/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52_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_52b_badSink(puVar1);
return;
}
| ['gcc'] |
9,719 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112597/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,720 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112597/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_badSink(param_1);
return;
}
| ['gcc'] |
9,721 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112597/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,722 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112597/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d17:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401394);
goto code_r0x00400d17;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,723 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112597/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_52c_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d2d:
func_0x00400b10(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013c4);
goto code_r0x00400d2d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,724 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53_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_53b_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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53_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_004013b4);
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_53b_badSink(puVar1);
return;
}
| ['gcc'] |
9,725 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,726 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_badSink(param_1);
return;
}
| ['gcc'] |
9,727 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,728 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_badSink(param_1);
return;
}
| ['gcc'] |
9,729 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53c_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,730 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d17:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d17;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,731 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112598/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_53d_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d2d:
func_0x00400b10(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013d4);
goto code_r0x00400d2d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,732 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54_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_54b_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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54_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_004013d4);
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_54b_badSink(puVar1);
return;
}
| ['gcc'] |
9,733 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,734 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_badSink(param_1);
return;
}
| ['gcc'] |
9,735 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,736 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_badSink(param_1);
return;
}
| ['gcc'] |
9,737 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54c_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,738 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_badSink(param_1);
return;
}
| ['gcc'] |
9,739 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54d_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,740 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d17:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013d4);
goto code_r0x00400d17;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,741 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112599/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_54e_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d2d:
func_0x00400b10(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013f4);
goto code_r0x00400d2d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,742 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112600/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400bc0(100);
*puVar1 = 0;
pcStack_10 = (char *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_badSource
(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400d38:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401384);
goto code_r0x00400d38;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,743 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112600/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,744 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_badSource(char * data)
{
{
/* 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';
}
}
}
return 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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112600/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_badSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_badSource(long param_1)
{
long lVar1;
long lVar2;
lVar1 = func_0x00400b40(param_1);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(param_1 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401384);
*(undefined *)(lVar1 + param_1) = 0;
}
else {
lVar1 = func_0x00400b40(param_1);
if ((lVar1 != 0) && (*(char *)(param_1 + lVar1 + -1) == '\n')) {
*(undefined *)(param_1 + lVar1 + -1) = 0;
}
}
}
return param_1;
}
| ['gcc'] |
9,745 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_goodB2GSource(char * data)
{
{
/* 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';
}
}
}
return 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 */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112600/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_goodB2GSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_61b_goodB2GSource(long param_1)
{
long lVar1;
long lVar2;
lVar1 = func_0x00400b40(param_1);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b80(param_1 + lVar1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_004013a4);
*(undefined *)(lVar1 + param_1) = 0;
}
else {
lVar1 = func_0x00400b40(param_1);
if ((lVar1 != 0) && (*(char *)(param_1 + lVar1 + -1) == '\n')) {
*(undefined *)(param_1 + lVar1 + -1) = 0;
}
}
}
return param_1;
}
| ['gcc'] |
9,746 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63_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_63b_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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112602/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63_bad(void)
{
long lVar1;
undefined *puStack_18;
long lStack_10;
puStack_18 = (undefined *)func_0x00400bc0(100);
*puStack_18 = 0;
lStack_10 = func_0x00400b40(puStack_18);
if (1 < 100U - lStack_10) {
lVar1 = func_0x00400b80(puStack_18 + lStack_10,100 - (int)lStack_10,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401384);
puStack_18[lStack_10] = 0;
}
else {
lStack_10 = func_0x00400b40(puStack_18);
if ((lStack_10 != 0) && (puStack_18[lStack_10 + -1] == '\n')) {
puStack_18[lStack_10 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b_badSink(&puStack_18);
return;
}
| ['gcc'] |
9,747 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112602/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,748 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112602/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d22:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401384);
goto code_r0x00400d22;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,749 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112602/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_63b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b40(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d38:
func_0x00400b10(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d38;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,750 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64_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_64b_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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112603/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64_bad(void)
{
long lVar1;
undefined *puStack_18;
long lStack_10;
puStack_18 = (undefined *)func_0x00400bc0(100);
*puStack_18 = 0;
lStack_10 = func_0x00400b40(puStack_18);
if (1 < 100U - lStack_10) {
lVar1 = func_0x00400b80(puStack_18 + lStack_10,100 - (int)lStack_10,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401394);
puStack_18[lStack_10] = 0;
}
else {
lStack_10 = func_0x00400b40(puStack_18);
if ((lStack_10 != 0) && (puStack_18[lStack_10 + -1] == '\n')) {
puStack_18[lStack_10 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b_badSink(&puStack_18);
return;
}
| ['gcc'] |
9,751 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112603/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,752 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112603/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d2a:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401394);
goto code_r0x00400d2a;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,753 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112603/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_64b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b40(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d40:
func_0x00400b10(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d40;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,754 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65_bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b_badSink;
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';
}
}
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* 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 */', '/* use the function pointer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112604/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65_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_00401384);
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_65b_badSink(puVar1);
return;
}
| ['gcc'] |
9,755 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112604/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,756 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112604/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d17:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401384);
goto code_r0x00400d17;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,757 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112604/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_65b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d2d:
func_0x00400b10(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d2d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,758 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66_bad()
{
char * data;
char * dataArray[5];
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';
}
}
}
/* put data in array */
dataArray[2] = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b_badSink(dataArray);
} | ['/* 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 */', '/* put data in array */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112605/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66_bad(void)
{
long lVar1;
undefined auStack_48 [16];
undefined *puStack_38;
long lStack_18;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400bc0(100);
*puStack_10 = 0;
lStack_18 = func_0x00400b40(puStack_10);
if (1 < 100U - lStack_18) {
lVar1 = func_0x00400b80(puStack_10 + lStack_18,100 - (int)lStack_18,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401394);
puStack_10[lStack_18] = 0;
}
else {
lStack_18 = func_0x00400b40(puStack_10);
if ((lStack_18 != 0) && (puStack_10[lStack_18 + -1] == '\n')) {
puStack_10[lStack_18 + -1] = 0;
}
}
}
puStack_38 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b_badSink(auStack_48);
return;
}
| ['gcc'] |
9,759 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112605/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,760 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112605/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b_badSink(long param_1)
{
char *pcStack_10;
pcStack_10 = *(char **)(param_1 + 0x10);
do {
if (*pcStack_10 == '\0') {
code_r0x00400d23:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401394);
goto code_r0x00400d23;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,761 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112605/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_66b_goodB2GSink(long param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *(long *)(param_1 + 0x10);
uStack_10 = 0;
do {
uVar2 = func_0x00400b40(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d39:
func_0x00400b10(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d39;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,762 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_structType myStruct;
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';
}
}
}
myStruct.structFirst = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_badSink(myStruct);
} | ['/* 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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112606/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_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_67b_badSink(puVar1);
return;
}
| ['gcc'] |
9,763 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112606/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,764 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112606/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d1f:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401394);
goto code_r0x00400d1f;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,765 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112606/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_67b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b40(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d35:
func_0x00400b10(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d35;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,766 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_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_68_badDataForBadSink = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_badSink();
} | ['/* 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 */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112607/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_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_68_badDataForBadSink = puVar1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_badSink();
return;
}
| ['gcc'] |
9,767 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112607/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,768 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_badSink()
{
char * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112607/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_badSink(void)
{
char *pcStack_10;
pcStack_10 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_badDataForBadSink;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d1e:
func_0x00400b10(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401394);
goto code_r0x00400d1e;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,769 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_goodB2GSink()
{
char * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_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/112607/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68b_goodB2GSink(void)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_console_68_badDataForGoodSink;
uStack_10 = 0;
do {
uVar2 = func_0x00400b40(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d34:
func_0x00400b10(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d34;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,770 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-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);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112615/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d83:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
goto code_r0x00400d83;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,771 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112615/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_01_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,772 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(1)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112616/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d83:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
goto code_r0x00400d83;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,773 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112616/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_02_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,774 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(5==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112617/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d83:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
goto code_r0x00400d83;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,775 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112617/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_03_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,776 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112618/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_0040131c);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d8c:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401320);
goto code_r0x00400d8c;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,777 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112618/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_04_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,778 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112619/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
if (staticTrue != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,779 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112619/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_05_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,780 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112620/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401318);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d8d:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_0040131c);
goto code_r0x00400d8d;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,781 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112620/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_06_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,782 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112621/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
if (staticFive == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,783 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112621/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_07_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,784 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112622/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b50(pcStack_10);
lVar3 = func_0x00400b10(&UNK_00401334);
if (lVar3 != 0) {
func_0x00400b70(pcStack_10 + lVar2,lVar3,99 - lVar2);
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401338);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,785 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112622/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_08_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,786 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112623/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
if (GLOBAL_CONST_TRUE != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,787 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112623/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_09_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,788 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112624/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
if (globalTrue != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,789 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112624/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_10_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,790 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112625/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b50(pcStack_10);
lVar3 = func_0x00400b10(&UNK_00401324);
if (lVar3 != 0) {
func_0x00400b70(pcStack_10 + lVar2,lVar3,99 - lVar2);
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401328);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,791 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112625/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_11_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,792 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112626/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uVar4;
ulong uStack_18;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b50(pcStack_10);
lVar3 = func_0x00400b10(&UNK_00401364);
if (lVar3 != 0) {
func_0x00400b70(pcStack_10 + lVar2,lVar3,99 - lVar2);
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
for (uStack_18 = 0; uVar4 = func_0x00400b50(pcStack_10), uStack_18 < uVar4;
uStack_18 = uStack_18 + 1) {
if (pcStack_10[uStack_18] == 'S') {
printLine(&UNK_00401368);
break;
}
}
func_0x00400b20(pcStack_10);
}
else {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401368);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,793 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112626/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_12_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,794 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112627/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
if (GLOBAL_CONST_FIVE == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,795 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112627/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_13_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,796 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112628/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
if (globalFive == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,797 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112628/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_14_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,798 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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;
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* 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/112629/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d83:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
goto code_r0x00400d83;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,799 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112629/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_15_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.