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,900 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112677/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,901 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
while(1)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
break;
}
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112678/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16_bad(void)
{
long lVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b80(pcStack_10);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400c30(&UNK_00401396,&UNK_00401394);
if (lVar2 != 0) {
lVar3 = func_0x00400bc0(pcStack_10 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013a4);
pcStack_10[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400e08:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b3);
goto code_r0x00400e08;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,902 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112678/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_16_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,903 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17_bad()
{
int j;
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
for(j = 0; j < 1; j++)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112679/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17_bad(void)
{
long lVar1;
long lVar2;
long lVar3;
char *pcStack_18;
int iStack_c;
pcStack_18 = (char *)func_0x00400c00(100);
*pcStack_18 = '\0';
lVar1 = func_0x00400b80(pcStack_18);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400c30(&UNK_004013a6,&UNK_004013a4);
if (lVar2 != 0) {
lVar3 = func_0x00400bc0(pcStack_18 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013b4);
pcStack_18[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
}
iStack_c = 0;
do {
if (0 < iStack_c) {
return;
}
for (; *pcStack_18 != '\0'; pcStack_18 = pcStack_18 + 1) {
if (*pcStack_18 == 'S') {
printLine(&UNK_004013c3);
break;
}
}
func_0x00400b40(pcStack_18);
iStack_c = iStack_c + 1;
} while( true );
}
| ['gcc'] |
9,904 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112679/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_17_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,905 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
goto sink;
sink:
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112680/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18_bad(void)
{
long lVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b80(pcStack_10);
if ((1 < 100U - lVar1) && (lVar2 = func_0x00400c30(&UNK_00401396,&UNK_00401394), lVar2 != 0)) {
lVar3 = func_0x00400bc0(pcStack_10 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013a4);
pcStack_10[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400e05:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b3);
goto code_r0x00400e05;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,906 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112680/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_18_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,907 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
badStatic = 1; /* true */
badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112681/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013d7,&UNK_004013d5);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013e5);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
badStatic = 1;
badSink(puVar1);
return;
}
| ['gcc'] |
9,908 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112681/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_21_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,909 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badGlobal = 1; /* true */
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112682/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013d4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badGlobal = 1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badSink(puVar1);
return;
}
| ['gcc'] |
9,910 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112682/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,911 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badSink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badGlobal)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112682/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_badGlobal != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c4);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,912 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G1Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112682/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G1Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G1Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G1Global == 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401539);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b40(param_1);
}
else {
printLine(&UNK_00401524);
}
return;
}
| ['gcc'] |
9,913 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G2Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G2Global)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112682/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G2Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G2Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_22_goodB2G2Global != 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401539);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b40(param_1);
}
return;
}
| ['gcc'] |
9,914 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
{
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 a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112683/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_bad(void)
{
long lVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b80(pcStack_10);
if ((1 < 100U - lVar1) && (lVar2 = func_0x00400c30(&UNK_004013a6,&UNK_004013a4), lVar2 != 0)) {
lVar3 = func_0x00400bc0(pcStack_10 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013b4);
pcStack_10[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400e14:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c3);
goto code_r0x00400e14;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,915 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112683/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_31_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,916 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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 a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
*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 a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112684/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32_bad(void)
{
long lVar1;
char *pcStack_40;
long lStack_38;
long lStack_30;
char *pcStack_28;
char **ppcStack_20;
char **ppcStack_18;
char *pcStack_10;
ppcStack_18 = &pcStack_40;
ppcStack_20 = &pcStack_40;
pcStack_40 = (char *)func_0x00400c00(100);
*pcStack_40 = '\0';
pcStack_28 = *ppcStack_18;
lStack_30 = func_0x00400b80(pcStack_28);
if (1 < 100U - lStack_30) {
lStack_38 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lStack_38 != 0) {
lVar1 = func_0x00400bc0(pcStack_28 + lStack_30,100 - (int)lStack_30,lStack_38);
if (lVar1 == 0) {
printLine(&UNK_004013d4);
pcStack_28[lStack_30] = '\0';
}
func_0x00400b70(lStack_38);
}
}
*ppcStack_18 = pcStack_28;
pcStack_10 = *ppcStack_20;
do {
if (*pcStack_10 == '\0') {
code_r0x00400e35:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013e3);
goto code_r0x00400e35;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,917 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112684/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_32_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,918 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_unionType myUnion;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
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 a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112686/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_bad(void)
{
long lVar1;
long lVar2;
long lVar3;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b80(pcStack_10);
if ((1 < 100U - lVar1) && (lVar2 = func_0x00400c30(&UNK_004013a6,&UNK_004013a4), lVar2 != 0)) {
lVar3 = func_0x00400bc0(pcStack_10 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013b4);
pcStack_10[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400e14:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c3);
goto code_r0x00400e14;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,919 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112686/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_34_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,920 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112687/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013c7,&UNK_004013c5);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013d5);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
badSink(puVar1);
return;
}
| ['gcc'] |
9,921 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112687/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_41_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,922 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112688/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
pcStack_10 = (char *)badSource(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400e26:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013d3);
goto code_r0x00400e26;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,923 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112688/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_42_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,924 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44_bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = badSink;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112690/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013c7,&UNK_004013c5);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013d5);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
badSink(puVar1);
return;
}
| ['gcc'] |
9,925 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112690/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_44_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,926 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_badData = data;
badSink();
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112691/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013d7,&UNK_004013d5);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013e5);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_badData = puVar1;
badSink();
return;
}
| ['gcc'] |
9,927 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112691/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_45_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,928 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b_badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112692/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013b6,&UNK_004013b4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013c4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b_badSink(puVar1);
return;
}
| ['gcc'] |
9,929 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112692/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,930 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112692/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d67:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d67;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,931 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112692/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_51b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d7d:
func_0x00400b40(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013d4);
goto code_r0x00400d7d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,932 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112693/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013d4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_badSink(puVar1);
return;
}
| ['gcc'] |
9,933 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112693/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,934 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112693/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_badSink(param_1);
return;
}
| ['gcc'] |
9,935 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112693/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,936 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112693/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d67:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c4);
goto code_r0x00400d67;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,937 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112693/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_52c_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d7d:
func_0x00400b40(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013f4);
goto code_r0x00400d7d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,938 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013e6,&UNK_004013e4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013f4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_badSink(puVar1);
return;
}
| ['gcc'] |
9,939 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,940 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_badSink(param_1);
return;
}
| ['gcc'] |
9,941 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,942 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_badSink(param_1);
return;
}
| ['gcc'] |
9,943 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53c_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,944 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d67:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d67;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,945 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112694/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_53d_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d7d:
func_0x00400b40(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401404);
goto code_r0x00400d7d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,946 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_badSink(data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_00401406,&UNK_00401404);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_00401414);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_badSink(puVar1);
return;
}
| ['gcc'] |
9,947 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,948 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_badSink(param_1);
return;
}
| ['gcc'] |
9,949 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,950 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_badSink(param_1);
return;
}
| ['gcc'] |
9,951 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54c_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,952 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_badSink(param_1);
return;
}
| ['gcc'] |
9,953 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54d_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,954 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d67:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401404);
goto code_r0x00400d67;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,955 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112695/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_54e_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d7d:
func_0x00400b40(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401424);
goto code_r0x00400d7d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,956 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112696/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
pcStack_10 = (char *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_badSource(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400d88:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d88;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,957 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112696/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,958 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_badSource(char * data)
{
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
return data;
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112696/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_badSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_badSource(long param_1)
{
long lVar1;
long lVar2;
long lVar3;
lVar1 = func_0x00400b80(param_1);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400c30(&UNK_004013b6,&UNK_004013b4);
if (lVar2 != 0) {
lVar3 = func_0x00400bc0(param_1 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013c4);
*(undefined *)(lVar1 + param_1) = 0;
}
func_0x00400b70(lVar2);
}
}
return param_1;
}
| ['gcc'] |
9,959 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_goodB2GSource(char * data)
{
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
return data;
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112696/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_goodB2GSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_61b_goodB2GSource(long param_1)
{
long lVar1;
long lVar2;
long lVar3;
lVar1 = func_0x00400b80(param_1);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400c30(&UNK_004013d6,&UNK_004013d4);
if (lVar2 != 0) {
lVar3 = func_0x00400bc0(param_1 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013e4);
*(undefined *)(lVar1 + param_1) = 0;
}
func_0x00400b70(lVar2);
}
}
return param_1;
}
| ['gcc'] |
9,960 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b_badSink(&data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112698/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63_bad(void)
{
long lVar1;
undefined *puStack_20;
long lStack_18;
long lStack_10;
puStack_20 = (undefined *)func_0x00400c00(100);
*puStack_20 = 0;
lStack_10 = func_0x00400b80(puStack_20);
if (1 < 100U - lStack_10) {
lStack_18 = func_0x00400c30(&UNK_004013b6,&UNK_004013b4);
if (lStack_18 != 0) {
lVar1 = func_0x00400bc0(puStack_20 + lStack_10,100 - (int)lStack_10,lStack_18);
if (lVar1 == 0) {
printLine(&UNK_004013c4);
puStack_20[lStack_10] = 0;
}
func_0x00400b70(lStack_18);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b_badSink(&puStack_20);
return;
}
| ['gcc'] |
9,961 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112698/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,962 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112698/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d72:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d72;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,963 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112698/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_63b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b80(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d88:
func_0x00400b40(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d88;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,964 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b_badSink(&data);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112699/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64_bad(void)
{
long lVar1;
undefined *puStack_20;
long lStack_18;
long lStack_10;
puStack_20 = (undefined *)func_0x00400c00(100);
*puStack_20 = 0;
lStack_10 = func_0x00400b80(puStack_20);
if (1 < 100U - lStack_10) {
lStack_18 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lStack_18 != 0) {
lVar1 = func_0x00400bc0(puStack_20 + lStack_10,100 - (int)lStack_10,lStack_18);
if (lVar1 == 0) {
printLine(&UNK_004013d4);
puStack_20[lStack_10] = 0;
}
func_0x00400b70(lStack_18);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b_badSink(&puStack_20);
return;
}
| ['gcc'] |
9,965 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112699/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,966 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112699/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d7a:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c4);
goto code_r0x00400d7a;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,967 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112699/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_64b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b80(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d90:
func_0x00400b40(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d90;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,968 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65_bad()
{
char * data;
/* define a function pointer */
void (*funcPtr) (char *) = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b_badSink;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
/* use the function pointer */
funcPtr(data);
} | ['/* define a function pointer */', '/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112700/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013b6,&UNK_004013b4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013c4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b_badSink(puVar1);
return;
}
| ['gcc'] |
9,969 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112700/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,970 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112700/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d67:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b4);
goto code_r0x00400d67;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,971 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112700/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_65b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d7d:
func_0x00400b40(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d7d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,972 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66_bad()
{
char * data;
char * dataArray[5];
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
/* put data in array */
dataArray[2] = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b_badSink(dataArray);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* 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/112701/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66_bad(void)
{
long lVar1;
undefined auStack_48 [16];
undefined *puStack_38;
long lStack_20;
long lStack_18;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400c00(100);
*puStack_10 = 0;
lStack_18 = func_0x00400b80(puStack_10);
if (1 < 100U - lStack_18) {
lStack_20 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lStack_20 != 0) {
lVar1 = func_0x00400bc0(puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20);
if (lVar1 == 0) {
printLine(&UNK_004013d4);
puStack_10[lStack_18] = 0;
}
func_0x00400b70(lStack_20);
}
}
puStack_38 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b_badSink(auStack_48);
return;
}
| ['gcc'] |
9,973 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112701/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,974 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112701/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b_badSink(long param_1)
{
char *pcStack_10;
pcStack_10 = *(char **)(param_1 + 0x10);
do {
if (*pcStack_10 == '\0') {
code_r0x00400d73:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c4);
goto code_r0x00400d73;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,975 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112701/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_66b_goodB2GSink(long param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *(long *)(param_1 + 0x10);
uStack_10 = 0;
do {
uVar2 = func_0x00400b80(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d89:
func_0x00400b40(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d89;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,976 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_structType myStruct;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
myStruct.structFirst = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_badSink(myStruct);
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112702/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013d4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_badSink(puVar1);
return;
}
| ['gcc'] |
9,977 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112702/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,978 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112702/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d6f:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c4);
goto code_r0x00400d6f;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,979 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112702/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_67b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b80(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d85:
func_0x00400b40(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d85;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,980 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Read input from a file */
size_t dataLen = strlen(data);
FILE * pFile;
/* if there is room in data, attempt to read the input from a file */
if (100-dataLen > 1)
{
pFile = fopen(FILENAME, "r");
if (pFile != NULL)
{
/* POTENTIAL FLAW: Read data from a file */
if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL)
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
fclose(pFile);
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_badDataForBadSink = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_badSink();
} | ['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112703/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
long lVar4;
puVar1 = (undefined *)func_0x00400c00(100);
*puVar1 = 0;
lVar2 = func_0x00400b80(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400c30(&UNK_004013c6,&UNK_004013c4);
if (lVar3 != 0) {
lVar4 = func_0x00400bc0(puVar1 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013d4);
puVar1[lVar2] = 0;
}
func_0x00400b70(lVar3);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_badDataForBadSink = puVar1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_badSink();
return;
}
| ['gcc'] |
9,981 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112703/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,982 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_badSink()
{
char * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112703/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_badSink(void)
{
char *pcStack_10;
pcStack_10 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_badDataForBadSink;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d6e:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c4);
goto code_r0x00400d6e;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,983 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_goodB2GSink()
{
char * data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_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/112703/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68b_goodB2GSink(void)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_68_badDataForGoodSink;
uStack_10 = 0;
do {
uVar2 = func_0x00400b80(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d84:
func_0x00400b40(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_004013e4);
goto code_r0x00400d84;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,984 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
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);
}
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* 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/112718/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_bad(void)
{
int iVar1;
undefined8 *puStack_10;
puStack_10 = (undefined8 *)func_0x00400ab0(100);
*(undefined *)puStack_10 = 0;
*puStack_10 = 0x7453206465786946;
*(undefined4 *)(puStack_10 + 1) = 0x676e6972;
*(undefined *)((long)puStack_10 + 0xc) = 0;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
for (; *(char *)puStack_10 != '\0'; puStack_10 = (undefined8 *)((long)puStack_10 + 1)) {
if (*(char *)puStack_10 == 'S') {
printLine(&UNK_004011e4);
break;
}
}
func_0x00400a20(puStack_10);
}
return;
}
| ['gcc'] |
9,985 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112718/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_08_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,986 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
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);
}
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* 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/112721/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11_bad(void)
{
int iVar1;
undefined8 *puStack_10;
puStack_10 = (undefined8 *)func_0x00400ab0(100);
*(undefined *)puStack_10 = 0;
*puStack_10 = 0x7453206465786946;
*(undefined4 *)(puStack_10 + 1) = 0x676e6972;
*(undefined *)((long)puStack_10 + 0xc) = 0;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
for (; *(char *)puStack_10 != '\0'; puStack_10 = (undefined8 *)((long)puStack_10 + 1)) {
if (*(char *)puStack_10 == 'S') {
printLine(&UNK_004011d4);
break;
}
}
func_0x00400a20(puStack_10);
}
return;
}
| ['gcc'] |
9,987 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112721/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_11_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,988 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
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);
}
}
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* 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/112722/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_bad(void)
{
int iVar1;
ulong uVar2;
ulong uStack_18;
undefined8 *puStack_10;
puStack_10 = (undefined8 *)func_0x00400b00(100);
*(undefined *)puStack_10 = 0;
*puStack_10 = 0x7453206465786946;
*(undefined4 *)(puStack_10 + 1) = 0x676e6972;
*(undefined *)((long)puStack_10 + 0xc) = 0;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
for (uStack_18 = 0; uVar2 = func_0x00400a90(puStack_10), uStack_18 < uVar2;
uStack_18 = uStack_18 + 1) {
if (*(char *)(uStack_18 + (long)puStack_10) == 'S') {
printLine(&UNK_00401274);
break;
}
}
func_0x00400a60(puStack_10);
}
else {
for (; *(char *)puStack_10 != '\0'; puStack_10 = (undefined8 *)((long)puStack_10 + 1)) {
if (*(char *)puStack_10 == 'S') {
printLine(&UNK_00401274);
break;
}
}
func_0x00400a60(puStack_10);
}
return;
}
| ['gcc'] |
9,989 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112722/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_12_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,990 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17_bad()
{
int j;
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
for(j = 0; j < 1; j++)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* 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/112727/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17_bad(void)
{
undefined8 *puStack_18;
int iStack_c;
puStack_18 = (undefined8 *)func_0x00400ab0(100);
*(undefined *)puStack_18 = 0;
*puStack_18 = 0x7453206465786946;
*(undefined4 *)(puStack_18 + 1) = 0x676e6972;
*(undefined *)((long)puStack_18 + 0xc) = 0;
iStack_c = 0;
do {
if (0 < iStack_c) {
return;
}
for (; *(char *)puStack_18 != '\0'; puStack_18 = (undefined8 *)((long)puStack_18 + 1)) {
if (*(char *)puStack_18 == 'S') {
printLine(&UNK_004011d4);
break;
}
}
func_0x00400a20(puStack_18);
iStack_c = iStack_c + 1;
} while( true );
}
| ['gcc'] |
9,991 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112727/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_17_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,992 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
badStatic = 1; /* true */
badSink(data);
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112729/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400ab0(100);
*(undefined *)puVar1 = 0;
*puVar1 = 0x7453206465786946;
*(undefined4 *)(puVar1 + 1) = 0x676e6972;
*(undefined *)((long)puVar1 + 0xc) = 0;
badStatic = 1;
badSink(puVar1);
return;
}
| ['gcc'] |
9,993 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112729/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_21_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,994 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badGlobal = 1; /* true */
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badSink(data);
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112730/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400ab0(100);
*(undefined *)puVar1 = 0;
*puVar1 = 0x7453206465786946;
*(undefined4 *)(puVar1 + 1) = 0x676e6972;
*(undefined *)((long)puVar1 + 0xc) = 0;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badGlobal = 1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badSink(puVar1);
return;
}
| ['gcc'] |
9,995 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112730/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,996 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badSink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badGlobal)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112730/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_badGlobal != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004011f4);
break;
}
}
func_0x00400a20(pcStack_10);
}
return;
}
| ['gcc'] |
9,997 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G1Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112730/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G1Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G1Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G1Global == 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400a90(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401349);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400a60(param_1);
}
else {
printLine(&UNK_00401334);
}
return;
}
| ['gcc'] |
9,998 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G2Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G2Global)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112730/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G2Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G2Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_22_goodB2G2Global != 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400a90(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401349);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400a60(param_1);
}
return;
}
| ['gcc'] |
9,999 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */
strcpy(data, BAD_SOURCE_FIXED_STRING);
{
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);
}
} | ['/* POTENTIAL FLAW: Initialize data to be a fixed string that contains the search character in the sinks */', '/* 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/112731/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_fixed_string_31_bad(void)
{
undefined8 *puStack_10;
puStack_10 = (undefined8 *)func_0x00400ab0(100);
*(undefined *)puStack_10 = 0;
*puStack_10 = 0x7453206465786946;
*(undefined4 *)(puStack_10 + 1) = 0x676e6972;
*(undefined *)((long)puStack_10 + 0xc) = 0;
do {
if (*(char *)puStack_10 == '\0') {
code_r0x00400c44:
func_0x00400a20(puStack_10);
return;
}
if (*(char *)puStack_10 == 'S') {
printLine(&UNK_004011d4);
goto code_r0x00400c44;
}
puStack_10 = (undefined8 *)((long)puStack_10 + 1);
} while( true );
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.