Unnamed: 0 int64 0 56k | source_code stringlengths 55 5.98k | comments stringlengths 2 1.76k | label stringclasses 68 values | dataset_name stringclasses 1 value | file_name stringlengths 208 265 | function stringlengths 27 87 | decompiled_code stringlengths 68 3.97k | compiler_options stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|
10,300 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
badSink(data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112879/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013b5);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
badSink(puVar1);
return;
}
| ['gcc'] |
10,301 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112879/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_41_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,302 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\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 != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112880/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42_bad(void)
{
undefined4 *puVar1;
int *piStack_10;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
piStack_10 = (int *)badSource(puVar1);
do {
if (*piStack_10 == 0) {
code_r0x00400e17:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013b4);
goto code_r0x00400e17;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,303 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112880/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_42_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,304 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_badSink(data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112884/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013a4);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_badSink(puVar1);
return;
}
| ['gcc'] |
10,305 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112884/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,306 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112884/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d16:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
goto code_r0x00400d16;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,307 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112884/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_51b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d35:
func_0x00400b10(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_004013d4);
goto code_r0x00400d35;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,308 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_badSink(data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112885/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013b4);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_badSink(puVar1);
return;
}
| ['gcc'] |
10,309 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112885/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,310 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112885/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_badSink(param_1);
return;
}
| ['gcc'] |
10,311 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112885/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,312 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112885/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d16:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013b4);
goto code_r0x00400d16;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,313 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112885/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_52c_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d35:
func_0x00400b10(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_004013e4);
goto code_r0x00400d35;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,314 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_badSink(data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013d4);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_badSink(puVar1);
return;
}
| ['gcc'] |
10,315 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,316 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_badSink(param_1);
return;
}
| ['gcc'] |
10,317 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,318 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_badSink(param_1);
return;
}
| ['gcc'] |
10,319 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53c_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,320 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d16:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013d4);
goto code_r0x00400d16;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,321 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112886/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_53d_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d35:
func_0x00400b10(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401404);
goto code_r0x00400d35;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,322 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_badSink(data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013f4);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_badSink(puVar1);
return;
}
| ['gcc'] |
10,323 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,324 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_badSink(param_1);
return;
}
| ['gcc'] |
10,325 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54b_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,326 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_badSink(param_1);
return;
}
| ['gcc'] |
10,327 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54c_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,328 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_badSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_badSink(data);
} | [] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_badSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_badSink(param_1);
return;
}
| ['gcc'] |
10,329 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_goodB2GSink(wchar_t * data)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_goodB2GSink(data);
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54d_goodB2GSink(undefined8 param_1)
{
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_goodB2GSink(param_1);
return;
}
| ['gcc'] |
10,330 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_badSink(wchar_t * data)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d16:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013f4);
goto code_r0x00400d16;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,331 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_goodB2GSink(wchar_t * data)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112887/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_54e_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d35:
func_0x00400b10(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401424);
goto code_r0x00400d35;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,332 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
data = CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_badSource(data);
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112888/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61_bad(void)
{
undefined4 *puVar1;
int *piStack_10;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
piStack_10 = (int *)CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_badSource
(puVar1);
do {
if (*piStack_10 == 0) {
code_r0x00400d3a:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
goto code_r0x00400d3a;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,333 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112888/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,334 | wchar_t * CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_badSource(wchar_t * data)
{
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
return data;
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112888/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_badSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_badSource(long param_1)
{
long lVar1;
long lVar2;
lVar1 = func_0x00400b60(param_1);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(lVar1 * 4 + param_1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_004013a4);
*(undefined4 *)(param_1 + lVar1 * 4) = 0;
}
else {
lVar1 = func_0x00400b60(param_1);
if ((lVar1 != 0) && (*(int *)(param_1 + lVar1 * 4 + -4) == 10)) {
*(undefined4 *)(param_1 + lVar1 * 4 + -4) = 0;
}
}
}
return param_1;
}
| ['gcc'] |
10,335 | wchar_t * CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_goodB2GSource(wchar_t * data)
{
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
return data;
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112888/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_goodB2GSource |
long CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_61b_goodB2GSource(long param_1)
{
long lVar1;
long lVar2;
lVar1 = func_0x00400b60(param_1);
if (1 < 100U - lVar1) {
lVar2 = func_0x00400b20(lVar1 * 4 + param_1,100 - (int)lVar1,stdin);
if (lVar2 == 0) {
printLine(&UNK_004013d4);
*(undefined4 *)(param_1 + lVar1 * 4) = 0;
}
else {
lVar1 = func_0x00400b60(param_1);
if ((lVar1 != 0) && (*(int *)(param_1 + lVar1 * 4 + -4) == 10)) {
*(undefined4 *)(param_1 + lVar1 * 4 + -4) = 0;
}
}
}
return param_1;
}
| ['gcc'] |
10,336 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_badSink(&data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112890/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63_bad(void)
{
long lVar1;
undefined4 *puStack_18;
long lStack_10;
puStack_18 = (undefined4 *)func_0x00400bc0(400);
*puStack_18 = 0;
lStack_10 = func_0x00400b60(puStack_18);
if (1 < 100U - lStack_10) {
lVar1 = func_0x00400b20(puStack_18 + lStack_10,100 - (int)lStack_10,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013a4);
puStack_18[lStack_10] = 0;
}
else {
lStack_10 = func_0x00400b60(puStack_18);
if ((lStack_10 != 0) && (puStack_18[lStack_10 + -1] == 10)) {
puStack_18[lStack_10 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_badSink(&puStack_18);
return;
}
| ['gcc'] |
10,337 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112890/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,338 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_badSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112890/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_badSink(int **param_1)
{
int *piStack_10;
piStack_10 = *param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d21:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
goto code_r0x00400d21;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,339 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_goodB2GSink(wchar_t * * dataPtr)
{
wchar_t * data = *dataPtr;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112890/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_63b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b60(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d40:
func_0x00400b10(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_004013d4);
goto code_r0x00400d40;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,340 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_badSink(&data);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112891/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64_bad(void)
{
long lVar1;
undefined4 *puStack_18;
long lStack_10;
puStack_18 = (undefined4 *)func_0x00400bc0(400);
*puStack_18 = 0;
lStack_10 = func_0x00400b60(puStack_18);
if (1 < 100U - lStack_10) {
lVar1 = func_0x00400b20(puStack_18 + lStack_10,100 - (int)lStack_10,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013a4);
puStack_18[lStack_10] = 0;
}
else {
lStack_10 = func_0x00400b60(puStack_18);
if ((lStack_10 != 0) && (puStack_18[lStack_10 + -1] == 10)) {
puStack_18[lStack_10 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_badSink(&puStack_18);
return;
}
| ['gcc'] |
10,341 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112891/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,342 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr;
/* dereference dataPtr into data */
wchar_t * data = (*dataPtr);
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112891/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_badSink(int **param_1)
{
int *piStack_10;
piStack_10 = *param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d29:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013a4);
goto code_r0x00400d29;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,343 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_goodB2GSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
wchar_t * * dataPtr = (wchar_t * *)dataVoidPtr;
/* dereference dataPtr into data */
wchar_t * data = (*dataPtr);
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112891/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_64b_goodB2GSink(long *param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *param_1;
uStack_10 = 0;
do {
uVar2 = func_0x00400b60(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d48:
func_0x00400b10(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_004013d4);
goto code_r0x00400d48;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,344 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66_bad()
{
wchar_t * data;
wchar_t * dataArray[5];
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
/* put data in array */
dataArray[2] = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_badSink(dataArray);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */', '/* put data in array */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112893/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66_bad(void)
{
long lVar1;
undefined auStack_48 [16];
undefined4 *puStack_38;
long lStack_18;
undefined4 *puStack_10;
puStack_10 = (undefined4 *)func_0x00400bc0(400);
*puStack_10 = 0;
lStack_18 = func_0x00400b60(puStack_10);
if (1 < 100U - lStack_18) {
lVar1 = func_0x00400b20(puStack_10 + lStack_18,100 - (int)lStack_18,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013b4);
puStack_10[lStack_18] = 0;
}
else {
lStack_18 = func_0x00400b60(puStack_10);
if ((lStack_18 != 0) && (puStack_10[lStack_18 + -1] == 10)) {
puStack_10[lStack_18 + -1] = 0;
}
}
}
puStack_38 = puStack_10;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_badSink(auStack_48);
return;
}
| ['gcc'] |
10,345 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112893/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,346 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_badSink(wchar_t * dataArray[])
{
/* copy data out of dataArray */
wchar_t * data = dataArray[2];
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* copy data out of dataArray */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112893/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_badSink(long param_1)
{
int *piStack_10;
piStack_10 = *(int **)(param_1 + 0x10);
do {
if (*piStack_10 == 0) {
code_r0x00400d22:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013b4);
goto code_r0x00400d22;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,347 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_goodB2GSink(wchar_t * dataArray[])
{
wchar_t * data = dataArray[2];
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112893/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_66b_goodB2GSink(long param_1)
{
long lVar1;
ulong uVar2;
ulong uStack_10;
lVar1 = *(long *)(param_1 + 0x10);
uStack_10 = 0;
do {
uVar2 = func_0x00400b60(lVar1);
if (uVar2 <= uStack_10) {
code_r0x00400d41:
func_0x00400b10(lVar1);
return;
}
if (*(int *)(lVar1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_004013e4);
goto code_r0x00400d41;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,348 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_bad()
{
wchar_t * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_structType myStruct;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Read input from the console */
size_t dataLen = wcslen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgetws(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgetws() */
dataLen = wcslen(data);
if (dataLen > 0 && data[dataLen-1] == L'\n')
{
data[dataLen-1] = L'\0';
}
}
else
{
printLine("fgetws() failed");
/* Restore NUL terminator if fgetws fails */
data[dataLen] = L'\0';
}
}
}
myStruct.structFirst = data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_badSink(myStruct);
} | ['/* Read input from the console */', '/* if there is room in data, read into it from the console */', '/* POTENTIAL FLAW: Read data from the console */', '/* The next few lines remove the carriage return from the string that is\r\n * inserted by fgetws() */', '/* Restore NUL terminator if fgetws fails */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112894/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bc0(400);
*puVar1 = 0;
lVar2 = func_0x00400b60(puVar1);
if (1 < 100U - lVar2) {
lVar3 = func_0x00400b20(puVar1 + lVar2,100 - (int)lVar2,stdin);
if (lVar3 == 0) {
printLine(&UNK_004013b4);
puVar1[lVar2] = 0;
}
else {
lVar2 = func_0x00400b60(puVar1);
if ((lVar2 != 0) && (puVar1[lVar2 + -1] == 10)) {
puVar1[lVar2 + -1] = 0;
}
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_badSink(puVar1);
return;
}
| ['gcc'] |
10,349 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112894/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,350 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_badSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112894/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
do {
if (*piStack_10 == 0) {
code_r0x00400d1e:
func_0x00400b10(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_004013b4);
goto code_r0x00400d1e;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,351 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_goodB2GSink(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67_structType myStruct)
{
wchar_t * data = myStruct.structFirst;
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112894/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_goodB2GSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_console_67b_goodB2GSink(long param_1)
{
ulong uVar1;
ulong uStack_10;
uStack_10 = 0;
do {
uVar1 = func_0x00400b60(param_1);
if (uVar1 <= uStack_10) {
code_r0x00400d3d:
func_0x00400b10(param_1);
return;
}
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_004013e4);
goto code_r0x00400d3d;
}
uStack_10 = uStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,352 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112903/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d8d:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401324);
goto code_r0x00400d8d;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,353 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112903/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_01_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,354 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(1)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112904/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d8d:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401324);
goto code_r0x00400d8d;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,355 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112904/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_02_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,356 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(STATIC_CONST_TRUE)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112906/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_0040132c);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d96:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_0040133c);
goto code_r0x00400d96;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,357 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112906/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_04_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,358 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(staticTrue)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112907/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
if (staticTrue != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,359 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112907/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_05_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,360 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(STATIC_CONST_FIVE==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112908/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401328);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d97:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401338);
goto code_r0x00400d97;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,361 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112908/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_06_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,362 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(staticFive==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112909/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
if (staticFive == 5) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,363 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112909/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_07_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,364 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(staticReturnsTrue())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112910/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar2 = func_0x00400b70(piStack_10);
lVar3 = func_0x00400b10(&UNK_00401344);
if (lVar3 != 0) {
func_0x00400b40(piStack_10 + lVar2,lVar3,99 - lVar2);
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401354);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,365 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112910/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_08_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,366 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(GLOBAL_CONST_TRUE)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112911/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
if (GLOBAL_CONST_TRUE != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,367 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112911/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_09_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,368 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(globalTrue)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112912/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
if (globalTrue != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,369 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112912/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_10_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,370 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(globalReturnsTrue())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112913/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar2 = func_0x00400b70(piStack_10);
lVar3 = func_0x00400b10(&UNK_00401324);
if (lVar3 != 0) {
func_0x00400b40(piStack_10 + lVar2,lVar3,99 - lVar2);
}
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,371 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112913/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_11_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,372 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(globalReturnsTrueOrFalse())
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
else
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112914/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uVar4;
ulong uStack_18;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar2 = func_0x00400b70(piStack_10);
lVar3 = func_0x00400b10(&UNK_00401384);
if (lVar3 != 0) {
func_0x00400b40(piStack_10 + lVar2,lVar3,99 - lVar2);
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
for (uStack_18 = 0; uVar4 = func_0x00400b70(piStack_10), uStack_18 < uVar4;
uStack_18 = uStack_18 + 1) {
if (piStack_10[uStack_18] == 0x53) {
printLine(&UNK_00401394);
break;
}
}
func_0x00400b20(piStack_10);
}
else {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401394);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,373 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112914/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_12_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,374 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(GLOBAL_CONST_FIVE==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112915/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
if (GLOBAL_CONST_FIVE == 5) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,375 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112915/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_13_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,376 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
if(globalFive==5)
{
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\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/112916/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
if (globalFive == 5) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,377 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112916/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_14_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,378 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
switch(6)
{
case 6:
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
} | ['/* Append input from an environment variable to data */', '/* If there is data in the environment variable */', '/* POTENTIAL FLAW: Read data from an environment variable */', '/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112917/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d8d:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401324);
goto code_r0x00400d8d;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,379 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112917/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_15_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,380 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(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 != L'\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/112918/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d8d:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401324);
goto code_r0x00400d8d;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,381 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112918/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_16_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,382 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17_bad()
{
int j;
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(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 != L'\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/112919/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17_bad(void)
{
long lVar1;
long lVar2;
int *piStack_18;
int iStack_c;
piStack_18 = (int *)func_0x00400bd0(400);
*piStack_18 = 0;
lVar1 = func_0x00400b70(piStack_18);
lVar2 = func_0x00400b10(&UNK_00401334);
if (lVar2 != 0) {
func_0x00400b40(piStack_18 + lVar1,lVar2,99 - lVar1);
}
iStack_c = 0;
do {
if (0 < iStack_c) {
return;
}
for (; *piStack_18 != 0; piStack_18 = piStack_18 + 1) {
if (*piStack_18 == 0x53) {
printLine(&UNK_00401344);
break;
}
}
func_0x00400b20(piStack_18);
iStack_c = iStack_c + 1;
} while( true );
}
| ['gcc'] |
10,383 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112919/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_17_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,384 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(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 != L'\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/112920/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401314);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d8e:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401324);
goto code_r0x00400d8e;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,385 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112920/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_18_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,386 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(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/112921/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bd0(400);
*puVar1 = 0;
lVar2 = func_0x00400b70(puVar1);
lVar3 = func_0x00400b10(&UNK_00401358);
if (lVar3 != 0) {
func_0x00400b40(puVar1 + lVar2,lVar3,99 - lVar2);
}
badStatic = 1;
badSink(puVar1);
return;
}
| ['gcc'] |
10,387 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112921/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_21_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,388 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badGlobal = 1; /* true */
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_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/112922/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bd0(400);
*puVar1 = 0;
lVar2 = func_0x00400b70(puVar1);
lVar3 = func_0x00400b10(&UNK_00401344);
if (lVar3 != 0) {
func_0x00400b40(puVar1 + lVar2,lVar3,99 - lVar2);
}
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badGlobal = 1;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badSink(puVar1);
return;
}
| ['gcc'] |
10,389 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_good()
{
goodB2G1();
goodB2G2();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112922/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22a.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_good(void)
{
goodB2G1();
goodB2G2();
return;
}
| ['gcc'] |
10,390 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badSink(wchar_t * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_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 != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the\r\n * memory block not at the start of the buffer */'] | ['CWE761'] | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112922/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badSink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badSink(int *param_1)
{
int *piStack_10;
piStack_10 = param_1;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_badGlobal != 0) {
for (; *piStack_10 != 0; piStack_10 = piStack_10 + 1) {
if (*piStack_10 == 0x53) {
printLine(&UNK_00401344);
break;
}
}
func_0x00400b20(piStack_10);
}
return;
}
| ['gcc'] |
10,391 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G1Sink(wchar_t * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_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 < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112922/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G1Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G1Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G1Global == 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b70(param_1);
if (uVar1 <= uStack_10) break;
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401499);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b20(param_1);
}
else {
printLine(&UNK_00401484);
}
return;
}
| ['gcc'] |
10,392 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G2Sink(wchar_t * data)
{
if(CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G2Global)
{
{
size_t i;
/* FIX: Use a loop variable to traverse through the string pointed to by data */
for (i=0; i < wcslen(data); i++)
{
if (data[i] == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
}
} | ['/* FIX: Use a loop variable to traverse through the string pointed to by data */'] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112922/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22b.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G2Sink |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G2Sink(long param_1)
{
ulong uVar1;
ulong uStack_10;
if (CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_22_goodB2G2Global != 0) {
uStack_10 = 0;
while( true ) {
uVar1 = func_0x00400b70(param_1);
if (uVar1 <= uStack_10) break;
if (*(int *)(param_1 + uStack_10 * 4) == 0x53) {
printLine(&UNK_00401499);
break;
}
uStack_10 = uStack_10 + 1;
}
func_0x00400b20(param_1);
}
return;
}
| ['gcc'] |
10,393 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
{
wchar_t * dataCopy = data;
wchar_t * data = dataCopy;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* 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/112923/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d9d:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
goto code_r0x00400d9d;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,394 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112923/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_31_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,395 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32_bad()
{
wchar_t * data;
wchar_t * *dataPtr1 = &data;
wchar_t * *dataPtr2 = &data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
wchar_t * data = *dataPtr1;
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
*dataPtr1 = data;
}
{
wchar_t * data = *dataPtr2;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* 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/112924/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32_bad(void)
{
int *piStack_40;
long lStack_38;
long lStack_30;
int *piStack_28;
int **ppiStack_20;
int **ppiStack_18;
int *piStack_10;
ppiStack_18 = &piStack_40;
ppiStack_20 = &piStack_40;
piStack_40 = (int *)func_0x00400bd0(400);
*piStack_40 = 0;
piStack_28 = *ppiStack_18;
lStack_30 = func_0x00400b70(piStack_28);
lStack_38 = func_0x00400b10(&UNK_00401344);
if (lStack_38 != 0) {
func_0x00400b40(piStack_28 + lStack_30,lStack_38,99 - lStack_30);
}
*ppiStack_18 = piStack_28;
piStack_10 = *ppiStack_20;
do {
if (*piStack_10 == 0) {
code_r0x00400dbe:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401354);
goto code_r0x00400dbe;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,396 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112924/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_32_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,397 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_bad()
{
wchar_t * data;
CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_unionType myUnion;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(data+dataLen, environment, 100-dataLen-1);
}
}
myUnion.unionFirst = data;
{
wchar_t * data = myUnion.unionSecond;
/* FLAW: We are incrementing the pointer in the loop - this will cause us to free the
* memory block not at the start of the buffer */
for (; *data != L'\0'; data++)
{
if (*data == SEARCH_CHAR)
{
printLine("We have a match!");
break;
}
}
free(data);
}
} | ['/* 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/112926/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_bad(void)
{
long lVar1;
long lVar2;
int *piStack_10;
piStack_10 = (int *)func_0x00400bd0(400);
*piStack_10 = 0;
lVar1 = func_0x00400b70(piStack_10);
lVar2 = func_0x00400b10(&UNK_00401324);
if (lVar2 != 0) {
func_0x00400b40(piStack_10 + lVar1,lVar2,99 - lVar1);
}
do {
if (*piStack_10 == 0) {
code_r0x00400d9d:
func_0x00400b20(piStack_10);
return;
}
if (*piStack_10 == 0x53) {
printLine(&UNK_00401334);
goto code_r0x00400d9d;
}
piStack_10 = piStack_10 + 1;
} while( true );
}
| ['gcc'] |
10,398 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_good()
{
goodB2G();
} | [] | null | mvd | /work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/112926/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_good |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_34_good(void)
{
goodB2G();
return;
}
| ['gcc'] |
10,399 | void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_41_bad()
{
wchar_t * data;
data = (wchar_t *)malloc(100*sizeof(wchar_t));
data[0] = L'\0';
{
/* Append input from an environment variable to data */
size_t dataLen = wcslen(data);
wchar_t * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
wcsncat(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/112927/CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_41.c | CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_41_bad |
void CWE761_Free_Pointer_Not_at_Start_of_Buffer__wchar_t_environment_41_bad(void)
{
undefined4 *puVar1;
long lVar2;
long lVar3;
puVar1 = (undefined4 *)func_0x00400bd0(400);
*puVar1 = 0;
lVar2 = func_0x00400b70(puVar1);
lVar3 = func_0x00400b10(&UNK_00401348);
if (lVar3 != 0) {
func_0x00400b40(puVar1 + lVar2,lVar3,99 - lVar2);
}
badSink(puVar1);
return;
}
| ['gcc'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.