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,800 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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;
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112630/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d83:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
goto code_r0x00400d83;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,801 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112630/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_16_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,802 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17_bad()
{
int j;
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112631/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_18;
int iStack_c;
pcStack_18 = (char *)func_0x00400bd0(100);
*pcStack_18 = '\0';
lVar1 = func_0x00400b50(pcStack_18);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b70(pcStack_18 + lVar1,lVar2,99 - lVar1);
}
iStack_c = 0;
do {
if (0 < iStack_c) {
return;
}
for (; *pcStack_18 != '\0'; pcStack_18 = pcStack_18 + 1) {
if (*pcStack_18 == 'S') {
printLine(&UNK_00401328);
break;
}
}
func_0x00400b20(pcStack_18);
iStack_c = iStack_c + 1;
} while( true );
}
| ['gcc'] |
9,803 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112631/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_17_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,804 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112632/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d84:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401318);
goto code_r0x00400d84;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,805 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112632/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_18_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,806 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
badStatic = 1; /* true */
badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112633/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401355);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
badStatic = 1;
badSink(puVar1);
return;
}
| ['gcc'] |
9,807 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112633/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_21_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,808 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badGlobal = 1; /* true */
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* true */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112634/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401344);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badGlobal = 1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badSink(puVar1);
return;
}
| ['gcc'] |
9,809 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112634/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,810 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badSink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112634/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_badGlobal != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401344);
break;
}
}
func_0x00400b20(pcStack_10);
}
return;
}
| ['gcc'] |
9,811 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G1Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112634/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G1Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G1Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G1Global == 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401479);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b20(param_1);
}
else {
printLine(&UNK_00401464);
}
return;
}
| ['gcc'] |
9,812 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G2Sink(char * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112634/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G2Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G2Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_22_goodB2G2Global != 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) break;
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401479);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b20(param_1);
}
return;
}
| ['gcc'] |
9,813 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
{
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112635/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d93:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401328);
goto code_r0x00400d93;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,814 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112635/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_31_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,815 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32_bad()
{
char * data;
char * *dataPtr1 = &data;
char * *dataPtr2 = &data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
char * data = *dataPtr1;
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
*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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112636/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32_bad(void)
{
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_0x00400bd0(100);
*pcStack_40 = '\0';
pcStack_28 = *ppcStack_18;
lStack_30 = func_0x00400b50(pcStack_28);
lStack_38 = func_0x00400b10(&UNK_00401344);
if (lStack_38 != 0) {
func_0x00400b70(pcStack_28 + lStack_30,lStack_38,99 - lStack_30);
}
*ppcStack_18 = pcStack_28;
pcStack_10 = *ppcStack_20;
do {
if (*pcStack_10 == '\0') {
code_r0x00400db4:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401348);
goto code_r0x00400db4;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,816 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112636/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_32_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,817 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_unionType myUnion;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
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);
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112638/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_bad(void)
{
long lVar1;
long lVar2;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400bd0(100);
*pcStack_10 = '\0';
lVar1 = func_0x00400b50(pcStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b70(pcStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400d93:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401328);
goto code_r0x00400d93;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,818 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112638/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_34_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,819 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112639/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401335);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
badSink(puVar1);
return;
}
| ['gcc'] |
9,820 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112639/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_41_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,821 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112640/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
pcStack_10 = (char *)badSource(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400da5:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401338);
goto code_r0x00400da5;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,822 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112640/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_42_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,823 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b_badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112644/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401324);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b_badSink(puVar1);
return;
}
| ['gcc'] |
9,824 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112644/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,825 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112644/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d27:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401324);
goto code_r0x00400d27;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,826 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112644/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_51b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d3d:
func_0x00400b20(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401354);
goto code_r0x00400d3d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,827 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112645/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401344);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_badSink(puVar1);
return;
}
| ['gcc'] |
9,828 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112645/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,829 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112645/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_badSink(param_1);
return;
}
| ['gcc'] |
9,830 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112645/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,831 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112645/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d27:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401344);
goto code_r0x00400d27;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,832 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112645/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_52c_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d3d:
func_0x00400b20(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401374);
goto code_r0x00400d3d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,833 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401364);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_badSink(puVar1);
return;
}
| ['gcc'] |
9,834 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,835 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_badSink(param_1);
return;
}
| ['gcc'] |
9,836 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,837 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_badSink(param_1);
return;
}
| ['gcc'] |
9,838 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53c_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,839 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d27:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401364);
goto code_r0x00400d27;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,840 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112646/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_53d_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d3d:
func_0x00400b20(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401384);
goto code_r0x00400d3d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,841 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_badSink(data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401384);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_badSink(puVar1);
return;
}
| ['gcc'] |
9,842 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,843 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_badSink(param_1);
return;
}
| ['gcc'] |
9,844 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54b_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,845 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_badSink(param_1);
return;
}
| ['gcc'] |
9,846 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54c_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,847 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_badSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_badSink(param_1);
return;
}
| ['gcc'] |
9,848 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_goodB2GSink(char * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54d_goodB2GSink
(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
9,849 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d27:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401384);
goto code_r0x00400d27;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,850 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112647/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_54e_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d3d:
func_0x00400b20(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_004013a4);
goto code_r0x00400d3d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,851 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112648/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61_bad(void)
{
undefined *puVar1;
char *pcStack_10;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
pcStack_10 = (char *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_badSource
(puVar1);
do {
if (*pcStack_10 == '\0') {
code_r0x00400d48:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401334);
goto code_r0x00400d48;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,852 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112648/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,853 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_badSource(char * data)
{
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
return data;
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112648/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_badSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_badSource(long param_1)
{
long lVar1;
long lVar2;
lVar1 = func_0x00400b50(param_1);
lVar2 = func_0x00400b10(&UNK_00401334);
if (lVar2 != 0) {
func_0x00400b70(param_1 + lVar1,lVar2,99 - lVar1);
}
return param_1;
}
| ['gcc'] |
9,854 | char * CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_goodB2GSource(char * data)
{
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
return data;
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112648/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_goodB2GSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_61b_goodB2GSource(long param_1)
{
long lVar1;
long lVar2;
lVar1 = func_0x00400b50(param_1);
lVar2 = func_0x00400b10(&UNK_00401354);
if (lVar2 != 0) {
func_0x00400b70(param_1 + lVar1,lVar2,99 - lVar1);
}
return param_1;
}
| ['gcc'] |
9,855 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b_badSink(&data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112650/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63_bad(void)
{
undefined *puStack_20;
long lStack_18;
long lStack_10;
puStack_20 = (undefined *)func_0x00400bd0(100);
*puStack_20 = 0;
lStack_10 = func_0x00400b50(puStack_20);
lStack_18 = func_0x00400b10(&UNK_00401334);
if (lStack_18 != 0) {
func_0x00400b70(puStack_20 + lStack_10,lStack_18,99 - lStack_10);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b_badSink(&puStack_20);
return;
}
| ['gcc'] |
9,856 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112650/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,857 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112650/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d32:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401334);
goto code_r0x00400d32;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,858 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112650/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_63b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b50(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d48:
func_0x00400b20(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401364);
goto code_r0x00400d48;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,859 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64_bad()
{
char * data;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b_badSink(&data);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112651/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64_bad(void)
{
undefined *puStack_20;
long lStack_18;
long lStack_10;
puStack_20 = (undefined *)func_0x00400bd0(100);
*puStack_20 = 0;
lStack_10 = func_0x00400b50(puStack_20);
lStack_18 = func_0x00400b10(&UNK_00401344);
if (lStack_18 != 0) {
func_0x00400b70(puStack_20 + lStack_10,lStack_18,99 - lStack_10);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b_badSink(&puStack_20);
return;
}
| ['gcc'] |
9,860 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112651/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,861 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112651/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b_badSink(char **param_1)
{
char *pcStack_10;
pcStack_10 = *param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d3a:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401344);
goto code_r0x00400d3a;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,862 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112651/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_64b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b50(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d50:
func_0x00400b20(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401364);
goto code_r0x00400d50;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,863 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66_bad()
{
char * data;
char * dataArray[5];
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
/* put data in array */
dataArray[2] = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b_badSink(dataArray);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* put data in array */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112653/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66_bad(void)
{
undefined auStack_48 [16];
undefined *puStack_38;
long lStack_20;
long lStack_18;
undefined *puStack_10;
puStack_10 = (undefined *)func_0x00400bd0(100);
*puStack_10 = 0;
lStack_18 = func_0x00400b50(puStack_10);
lStack_20 = func_0x00400b10(&UNK_00401344);
if (lStack_20 != 0) {
func_0x00400b70(puStack_10 + lStack_18,lStack_20,99 - lStack_18);
}
puStack_38 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b_badSink(auStack_48);
return;
}
| ['gcc'] |
9,864 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112653/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,865 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112653/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b_badSink(long param_1)
{
char *pcStack_10;
pcStack_10 = *(char **)(param_1 + 0x10);
do {
if (*pcStack_10 == '\0') {
code_r0x00400d33:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401344);
goto code_r0x00400d33;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,866 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112653/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_66b_goodB2GSink(long param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *(long *)(param_1 + 0x10);
uStack_10 = 0;
do {
uVar2 = func_0x00400b50(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d49:
func_0x00400b20(lVar1);
return;
}
if (*(char *)(uStack_10 + lVar1) == 'S') {
printLine(&UNK_00401364);
goto code_r0x00400d49;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,867 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_bad()
{
char * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_structType myStruct;
data = (char *)malloc(100*sizeof(char));
data[0] = '\0';
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
myStruct.structFirst = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_badSink(myStruct);
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112654/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_bad(void)
{
undefined *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined *)func_0x00400bd0(100);
*puVar1 = 0;
lVar2 = func_0x00400b50(puVar1);
lVar3 = func_0x00400b10(&UNK_00401334);
if (lVar3 != 0) {
func_0x00400b70(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_badSink(puVar1);
return;
}
| ['gcc'] |
9,868 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112654/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,869 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112654/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_badSink(char *param_1)
{
char *pcStack_10;
pcStack_10 = param_1;
do {
if (*pcStack_10 == '\0') {
code_r0x00400d2f:
func_0x00400b20(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_00401334);
goto code_r0x00400d2f;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,870 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_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/112654/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_environment_67b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b50(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d45:
func_0x00400b20(param_1);
return;
}
if (*(char *)(uStack_10 + param_1) == 'S') {
printLine(&UNK_00401364);
goto code_r0x00400d45;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,871 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01_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);
}
}
}
/* 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/112663/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01_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,872 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112663/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_01_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,873 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02_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);
}
}
}
if(1)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* 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/112664/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02_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,874 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112664/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_02_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,875 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03_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);
}
}
}
if(5==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* 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/112665/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03_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,876 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112665/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_03_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,877 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_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);
}
}
}
if(STATIC_CONST_TRUE)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112666/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_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_0040139e,&UNK_0040139c), lVar2 != 0)) {
lVar3 = func_0x00400bc0(pcStack_10 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013ac);
pcStack_10[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400e0d:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013bb);
goto code_r0x00400e0d;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,878 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112666/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_04_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,879 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_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);
}
}
}
if(staticTrue)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112667/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_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);
}
if (staticTrue != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,880 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112667/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_05_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,881 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06_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);
}
}
}
if(STATIC_CONST_FIVE==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112668/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06_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_0040139a,&UNK_00401398), lVar2 != 0)) {
lVar3 = func_0x00400bc0(pcStack_10 + lVar1,100 - (int)lVar1,lVar2);
if (lVar3 == 0) {
printLine(&UNK_004013a8);
pcStack_10[lVar1] = '\0';
}
func_0x00400b70(lVar2);
}
do {
if (*pcStack_10 == '\0') {
code_r0x00400e0e:
func_0x00400b40(pcStack_10);
return;
}
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b7);
goto code_r0x00400e0e;
}
pcStack_10 = pcStack_10 + 1;
} while( true );
}
| ['gcc'] |
9,882 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112668/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_06_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,883 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_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);
}
}
}
if(staticFive==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112669/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_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);
}
if (staticFive == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,884 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112669/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_07_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,885 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08_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);
}
}
}
if(staticReturnsTrue())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112670/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
long lVar4;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b80(pcStack_10);
if ((1 < 100U - lVar2) && (lVar3 = func_0x00400c30(&UNK_004013b6,&UNK_004013b4), lVar3 != 0)) {
lVar4 = func_0x00400bc0(pcStack_10 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013c4);
pcStack_10[lVar2] = '\0';
}
func_0x00400b70(lVar3);
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013d3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,886 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112670/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_08_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,887 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09_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);
}
}
}
if(GLOBAL_CONST_TRUE)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112671/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09_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);
}
if (GLOBAL_CONST_TRUE != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,888 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112671/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_09_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,889 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10_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);
}
}
}
if(globalTrue)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112672/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10_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);
}
if (globalTrue != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013b3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,890 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112672/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_10_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,891 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11_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);
}
}
}
if(globalReturnsTrue())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112673/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
long lVar4;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b80(pcStack_10);
if ((1 < 100U - lVar2) && (lVar3 = func_0x00400c30(&UNK_004013a6,&UNK_004013a4), lVar3 != 0)) {
lVar4 = func_0x00400bc0(pcStack_10 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_004013b4);
pcStack_10[lVar2] = '\0';
}
func_0x00400b70(lVar3);
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,892 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112673/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_11_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,893 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12_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);
}
}
}
if(globalReturnsTrueOrFalse())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
else
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < strlen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* Read input from 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 */', '/* 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/112674/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
long lVar4;
ulong uVar5;
ulong uStack_18;
char *pcStack_10;
pcStack_10 = (char *)func_0x00400c00(100);
*pcStack_10 = '\0';
lVar2 = func_0x00400b80(pcStack_10);
if ((1 < 100U - lVar2) && (lVar3 = func_0x00400c30(&UNK_004013f6,&UNK_004013f4), lVar3 != 0)) {
lVar4 = func_0x00400bc0(pcStack_10 + lVar2,100 - (int)lVar2,lVar3);
if (lVar4 == 0) {
printLine(&UNK_00401404);
pcStack_10[lVar2] = '\0';
}
func_0x00400b70(lVar3);
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
for (uStack_18 = 0; uVar5 = func_0x00400b80(pcStack_10), uStack_18 < uVar5;
uStack_18 = uStack_18 + 1) {
if (pcStack_10[uStack_18] == 'S') {
printLine(&UNK_00401413);
break;
}
}
func_0x00400b40(pcStack_10);
}
else {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_00401413);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,894 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112674/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_12_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
9,895 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13_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);
}
}
}
if(GLOBAL_CONST_FIVE==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112675/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13_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);
}
if (GLOBAL_CONST_FIVE == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,896 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112675/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_13_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,897 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_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);
}
}
}
if(globalFive==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* Read input from 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/112676/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_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);
}
if (globalFive == 5) {
for (; *pcStack_10 != '\0'; pcStack_10 = pcStack_10 + 1) {
if (*pcStack_10 == 'S') {
printLine(&UNK_004013c3);
break;
}
}
func_0x00400b40(pcStack_10);
}
return;
}
| ['gcc'] |
9,898 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112676/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_14_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
9,899 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15_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);
}
}
}
switch(6)
{
case 6:
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != '\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* Read input from 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 */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112677/CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__char_file_15_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'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.