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 |
|---|---|---|---|---|---|---|---|---|
54,200
|
void CWE400_Resource_Exhaustion__fgets_fwrite_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98678/CWE400_Resource_Exhaustion__fgets_fwrite_06.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_06_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,201
|
void CWE400_Resource_Exhaustion__fgets_fwrite_07_bad()
{
int count;
/* Initialize count */
count = -1;
if(staticFive==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
if(staticFive==5)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98679/CWE400_Resource_Exhaustion__fgets_fwrite_07.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_07_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_07_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
if (staticFive == 5) {
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401408);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
}
if (staticFive == 5) {
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_00401418;
lStack_20 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401430,1,0x32,lStack_20);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
}
return;
}
|
['gcc']
|
54,202
|
void CWE400_Resource_Exhaustion__fgets_fwrite_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98679/CWE400_Resource_Exhaustion__fgets_fwrite_07.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_07_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,203
|
void CWE400_Resource_Exhaustion__fgets_fwrite_08_bad()
{
int count;
/* Initialize count */
count = -1;
if(staticReturnsTrue())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
if(staticReturnsTrue())
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98680/CWE400_Resource_Exhaustion__fgets_fwrite_08.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_08_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_08_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar2 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar2 == 0) {
printLine(&UNK_00401418);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
}
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_00401428;
lStack_20 = func_0x00400c40(&UNK_00401428,&UNK_00401437);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar2 = func_0x00400c70(&UNK_00401440,1,0x32,lStack_20);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
}
return;
}
|
['gcc']
|
54,204
|
void CWE400_Resource_Exhaustion__fgets_fwrite_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98680/CWE400_Resource_Exhaustion__fgets_fwrite_08.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_08_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,205
|
void CWE400_Resource_Exhaustion__fgets_fwrite_09_bad()
{
int count;
/* Initialize count */
count = -1;
if(GLOBAL_CONST_TRUE)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
if(GLOBAL_CONST_TRUE)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98681/CWE400_Resource_Exhaustion__fgets_fwrite_09.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_09_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_09_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
if (GLOBAL_CONST_TRUE != 0) {
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401408);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
}
if (GLOBAL_CONST_TRUE != 0) {
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_00401418;
lStack_20 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401430,1,0x32,lStack_20);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
}
return;
}
|
['gcc']
|
54,206
|
void CWE400_Resource_Exhaustion__fgets_fwrite_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98681/CWE400_Resource_Exhaustion__fgets_fwrite_09.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_09_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,207
|
void CWE400_Resource_Exhaustion__fgets_fwrite_10_bad()
{
int count;
/* Initialize count */
count = -1;
if(globalTrue)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
if(globalTrue)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98682/CWE400_Resource_Exhaustion__fgets_fwrite_10.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_10_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_10_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
if (globalTrue != 0) {
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401408);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
}
if (globalTrue != 0) {
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_00401418;
lStack_20 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401430,1,0x32,lStack_20);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
}
return;
}
|
['gcc']
|
54,208
|
void CWE400_Resource_Exhaustion__fgets_fwrite_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98682/CWE400_Resource_Exhaustion__fgets_fwrite_10.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_10_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,209
|
void CWE400_Resource_Exhaustion__fgets_fwrite_12_bad()
{
int count;
/* Initialize count */
count = -1;
if(globalReturnsTrueOrFalse())
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
else
{
/* FIX: Use a relatively small number */
count = 20;
}
if(globalReturnsTrueOrFalse())
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
else
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* FIX: Use a relatively small number */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */', '/* FIX: Validate count before using it as the for loop variant to write to a file */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98684/CWE400_Resource_Exhaustion__fgets_fwrite_12.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_12_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_12_bad(void)
{
int iVar1;
long lVar2;
undefined8 uStack_4e;
undefined4 uStack_46;
undefined2 uStack_42;
undefined *puStack_40;
long lStack_38;
undefined *puStack_30;
long lStack_28;
ulong uStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
iStack_c = 0x14;
}
else {
uStack_4e = 0;
uStack_46 = 0;
uStack_42 = 0;
lVar2 = func_0x00400be0(&uStack_4e,0xe,stdin);
if (lVar2 == 0) {
printLine(&UNK_004014c8);
}
else {
iStack_c = func_0x00400c50(&uStack_4e);
}
}
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
uStack_20 = 0;
lStack_28 = 0;
puStack_30 = &UNK_00401523;
if ((0 < iStack_c) && (iStack_c < 0x15)) {
lStack_28 = func_0x00400c40(&UNK_00401523,&UNK_004014e7);
if (lStack_28 == 0) {
func_0x00400c60(1);
}
for (uStack_20 = 0; uStack_20 < (ulong)(long)iStack_c; uStack_20 = uStack_20 + 1) {
lVar2 = func_0x00400c70(&UNK_004014f0,1,0x32,lStack_28);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_28 != 0) {
func_0x00400ba0(lStack_28);
}
}
}
else {
uStack_18 = 0;
lStack_38 = 0;
puStack_40 = &UNK_004014d8;
lStack_38 = func_0x00400c40(&UNK_004014d8,&UNK_004014e7);
if (lStack_38 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar2 = func_0x00400c70(&UNK_004014f0,1,0x32,lStack_38);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_38 != 0) {
func_0x00400ba0(lStack_38);
}
}
return;
}
|
['gcc']
|
54,210
|
void CWE400_Resource_Exhaustion__fgets_fwrite_12_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98684/CWE400_Resource_Exhaustion__fgets_fwrite_12.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_12_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_12_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,211
|
void CWE400_Resource_Exhaustion__fgets_fwrite_14_bad()
{
int count;
/* Initialize count */
count = -1;
if(globalFive==5)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
if(globalFive==5)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98686/CWE400_Resource_Exhaustion__fgets_fwrite_14.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_14_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_14_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
if (globalFive == 5) {
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401408);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
}
if (globalFive == 5) {
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_00401418;
lStack_20 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401430,1,0x32,lStack_20);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
}
return;
}
|
['gcc']
|
54,212
|
void CWE400_Resource_Exhaustion__fgets_fwrite_14_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98686/CWE400_Resource_Exhaustion__fgets_fwrite_14.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_14_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_14_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,213
|
void CWE400_Resource_Exhaustion__fgets_fwrite_15_bad()
{
int count;
/* Initialize count */
count = -1;
switch(6)
{
case 6:
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
switch(7)
{
case 7:
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
break;
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98687/CWE400_Resource_Exhaustion__fgets_fwrite_15.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_15_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_15_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013e8);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_004013f8;
lStack_20 = func_0x00400c40(&UNK_004013f8,&UNK_00401407);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401410,1,0x32,lStack_20);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
return;
}
|
['gcc']
|
54,214
|
void CWE400_Resource_Exhaustion__fgets_fwrite_15_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98687/CWE400_Resource_Exhaustion__fgets_fwrite_15.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_15_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_15_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,215
|
void CWE400_Resource_Exhaustion__fgets_fwrite_17_bad()
{
int i,j;
int count;
/* Initialize count */
count = -1;
for(i = 0; i < 1; i++)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
}
for(j = 0; j < 1; j++)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98689/CWE400_Resource_Exhaustion__fgets_fwrite_17.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_17_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_17_bad(void)
{
long lVar1;
undefined8 uStack_3e;
undefined4 uStack_36;
undefined2 uStack_32;
undefined *puStack_30;
long lStack_28;
ulong uStack_20;
int iStack_14;
int iStack_10;
int iStack_c;
iStack_14 = -1;
for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) {
uStack_3e = 0;
uStack_36 = 0;
uStack_32 = 0;
lVar1 = func_0x00400be0(&uStack_3e,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401418);
}
else {
iStack_14 = func_0x00400c50(&uStack_3e);
}
}
for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) {
uStack_20 = 0;
lStack_28 = 0;
puStack_30 = &UNK_00401428;
lStack_28 = func_0x00400c40(&UNK_00401428,&UNK_00401437);
if (lStack_28 == 0) {
func_0x00400c60(1);
}
for (uStack_20 = 0; uStack_20 < (ulong)(long)iStack_14; uStack_20 = uStack_20 + 1) {
lVar1 = func_0x00400c70(&UNK_00401440,1,0x32,lStack_28);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_28 != 0) {
func_0x00400ba0(lStack_28);
}
}
return;
}
|
['gcc']
|
54,216
|
void CWE400_Resource_Exhaustion__fgets_fwrite_17_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98689/CWE400_Resource_Exhaustion__fgets_fwrite_17.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_17_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_17_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,217
|
void CWE400_Resource_Exhaustion__fgets_fwrite_18_bad()
{
int count;
/* Initialize count */
count = -1;
goto source;
source:
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
goto sink;
sink:
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98690/CWE400_Resource_Exhaustion__fgets_fwrite_18.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_18_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_18_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined *puStack_28;
long lStack_20;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013e8);
}
else {
iStack_c = func_0x00400c50(&uStack_36);
}
uStack_18 = 0;
lStack_20 = 0;
puStack_28 = &UNK_004013f8;
lStack_20 = func_0x00400c40(&UNK_004013f8,&UNK_00401407);
if (lStack_20 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401410,1,0x32,lStack_20);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_20 != 0) {
func_0x00400ba0(lStack_20);
}
return;
}
|
['gcc']
|
54,218
|
void CWE400_Resource_Exhaustion__fgets_fwrite_18_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98690/CWE400_Resource_Exhaustion__fgets_fwrite_18.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_18_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_18_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,219
|
void CWE400_Resource_Exhaustion__fgets_fwrite_21_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
badStatic = 1; /* true */
badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* true */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98691/CWE400_Resource_Exhaustion__fgets_fwrite_21.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_21_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_21_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401463);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
badStatic = 1;
badSink(uStack_c);
return;
}
|
['gcc']
|
54,220
|
void CWE400_Resource_Exhaustion__fgets_fwrite_21_good()
{
goodB2G1();
goodB2G2();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98691/CWE400_Resource_Exhaustion__fgets_fwrite_21.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_21_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_21_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
|
['gcc']
|
54,221
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_22_badGlobal = 1; /* true */
CWE400_Resource_Exhaustion__fgets_fwrite_22_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* true */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98692/CWE400_Resource_Exhaustion__fgets_fwrite_22a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_22_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401414);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_22_badGlobal = 1;
CWE400_Resource_Exhaustion__fgets_fwrite_22_badSink(uStack_c);
return;
}
|
['gcc']
|
54,222
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_good()
{
goodB2G1();
goodB2G2();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98692/CWE400_Resource_Exhaustion__fgets_fwrite_22a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_22_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_good(void)
{
goodB2G1();
goodB2G2();
goodG2B();
return;
}
|
['gcc']
|
54,223
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_badSink(int count)
{
if(CWE400_Resource_Exhaustion__fgets_fwrite_22_badGlobal)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98692/CWE400_Resource_Exhaustion__fgets_fwrite_22b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_22_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if (CWE400_Resource_Exhaustion__fgets_fwrite_22_badGlobal != 0) {
lVar1 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401430,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
54,224
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G1Sink(int count)
{
if(CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
}
|
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98692/CWE400_Resource_Exhaustion__fgets_fwrite_22b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G1Sink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G1Sink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if (CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G1Global == 0) {
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_0040167d,&UNK_0040168d);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401690,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
}
else {
printLine(&UNK_00401668);
}
return;
}
|
['gcc']
|
54,225
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G2Sink(int count)
{
if(CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G2Global)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98692/CWE400_Resource_Exhaustion__fgets_fwrite_22b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G2Sink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G2Sink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if (CWE400_Resource_Exhaustion__fgets_fwrite_22_goodB2G2Global != 0) {
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_0040167d,&UNK_0040168d);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401690,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
}
return;
}
|
['gcc']
|
54,226
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_goodG2BSink(int count)
{
if(CWE400_Resource_Exhaustion__fgets_fwrite_22_goodG2BGlobal)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98692/CWE400_Resource_Exhaustion__fgets_fwrite_22b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_22_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_22_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if (CWE400_Resource_Exhaustion__fgets_fwrite_22_goodG2BGlobal != 0) {
lVar1 = func_0x00400c40(&UNK_004016c3,&UNK_0040168d);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401690,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
54,227
|
void CWE400_Resource_Exhaustion__fgets_fwrite_31_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
{
int countCopy = count;
int count = countCopy;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98693/CWE400_Resource_Exhaustion__fgets_fwrite_31.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_31_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_31_bad(void)
{
long lVar1;
undefined8 uStack_3e;
undefined4 uStack_36;
undefined2 uStack_32;
undefined *puStack_30;
long lStack_28;
int iStack_20;
int iStack_1c;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
uStack_3e = 0;
uStack_36 = 0;
uStack_32 = 0;
lVar1 = func_0x00400be0(&uStack_3e,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013f8);
}
else {
iStack_c = func_0x00400c50(&uStack_3e);
}
iStack_1c = iStack_c;
iStack_20 = iStack_c;
uStack_18 = 0;
lStack_28 = 0;
puStack_30 = &UNK_00401408;
lStack_28 = func_0x00400c40(&UNK_00401408,&UNK_00401417);
if (lStack_28 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_20; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401420,1,0x32,lStack_28);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_28 != 0) {
func_0x00400ba0(lStack_28);
}
return;
}
|
['gcc']
|
54,228
|
void CWE400_Resource_Exhaustion__fgets_fwrite_31_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98693/CWE400_Resource_Exhaustion__fgets_fwrite_31.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_31_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_31_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,229
|
void CWE400_Resource_Exhaustion__fgets_fwrite_32_bad()
{
int count;
int *countPtr1 = &count;
int *countPtr2 = &count;
/* Initialize count */
count = -1;
{
int count = *countPtr1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
*countPtr1 = count;
}
{
int count = *countPtr2;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98694/CWE400_Resource_Exhaustion__fgets_fwrite_32.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_32_bad
|
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE400_Resource_Exhaustion__fgets_fwrite_32_bad(void)
{
long lVar1;
undefined8 uStack_52;
undefined4 uStack_4a;
undefined2 uStack_46;
int iStack_44;
undefined *puStack_40;
long lStack_38;
int iStack_2c;
int *piStack_28;
int *piStack_20;
ulong uStack_18;
int iStack_c;
piStack_20 = &iStack_44;
piStack_28 = &iStack_44;
iStack_44 = -1;
iStack_c = -1;
uStack_52 = 0;
uStack_4a = 0;
uStack_46 = 0;
lVar1 = func_0x00400be0(&uStack_52,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401418);
}
else {
iStack_c = func_0x00400c50(&uStack_52);
}
*piStack_20 = iStack_c;
iStack_2c = *piStack_28;
uStack_18 = 0;
lStack_38 = 0;
puStack_40 = &UNK_00401428;
lStack_38 = func_0x00400c40(&UNK_00401428,&UNK_00401437);
if (lStack_38 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_2c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401440,1,0x32,lStack_38);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_38 != 0) {
func_0x00400ba0(lStack_38);
}
return;
}
|
['gcc']
|
54,230
|
void CWE400_Resource_Exhaustion__fgets_fwrite_32_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98694/CWE400_Resource_Exhaustion__fgets_fwrite_32.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_32_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_32_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,231
|
void CWE400_Resource_Exhaustion__fgets_fwrite_34_bad()
{
int count;
CWE400_Resource_Exhaustion__fgets_fwrite_34_unionType myUnion;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
myUnion.unionFirst = count;
{
int count = myUnion.unionSecond;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98696/CWE400_Resource_Exhaustion__fgets_fwrite_34.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_34_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_34_bad(void)
{
long lVar1;
undefined8 uStack_42;
undefined4 uStack_3a;
undefined2 uStack_36;
int iStack_34;
undefined *puStack_30;
long lStack_28;
int iStack_1c;
ulong uStack_18;
int iStack_c;
iStack_c = -1;
uStack_42 = 0;
uStack_3a = 0;
uStack_36 = 0;
lVar1 = func_0x00400be0(&uStack_42,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_004013f8);
}
else {
iStack_c = func_0x00400c50(&uStack_42);
}
iStack_34 = iStack_c;
iStack_1c = iStack_c;
uStack_18 = 0;
lStack_28 = 0;
puStack_30 = &UNK_00401408;
lStack_28 = func_0x00400c40(&UNK_00401408,&UNK_00401417);
if (lStack_28 == 0) {
func_0x00400c60(1);
}
for (uStack_18 = 0; uStack_18 < (ulong)(long)iStack_1c; uStack_18 = uStack_18 + 1) {
lVar1 = func_0x00400c70(&UNK_00401420,1,0x32,lStack_28);
if (lVar1 != 0x32) {
func_0x00400c60(1);
}
}
if (lStack_28 != 0) {
func_0x00400ba0(lStack_28);
}
return;
}
|
['gcc']
|
54,232
|
void CWE400_Resource_Exhaustion__fgets_fwrite_34_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98696/CWE400_Resource_Exhaustion__fgets_fwrite_34.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_34_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_34_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,233
|
void CWE400_Resource_Exhaustion__fgets_fwrite_41_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98697/CWE400_Resource_Exhaustion__fgets_fwrite_41.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_41_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_41_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401453);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
badSink(uStack_c);
return;
}
|
['gcc']
|
54,234
|
void CWE400_Resource_Exhaustion__fgets_fwrite_41_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98697/CWE400_Resource_Exhaustion__fgets_fwrite_41.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_41_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_41_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,235
|
void CWE400_Resource_Exhaustion__fgets_fwrite_42_bad()
{
int count;
/* Initialize count */
count = -1;
count = badSource(count);
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98698/CWE400_Resource_Exhaustion__fgets_fwrite_42.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_42_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_42_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = badSource(0xffffffff);
lVar2 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401430,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,236
|
void CWE400_Resource_Exhaustion__fgets_fwrite_42_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98698/CWE400_Resource_Exhaustion__fgets_fwrite_42.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_42_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_42_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,237
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_51b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98702/CWE400_Resource_Exhaustion__fgets_fwrite_51a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_51_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401404);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_51b_badSink(uStack_c);
return;
}
|
['gcc']
|
54,238
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98702/CWE400_Resource_Exhaustion__fgets_fwrite_51a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_51_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,239
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51b_badSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98702/CWE400_Resource_Exhaustion__fgets_fwrite_51b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_51b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51b_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401408,&UNK_00401417);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401420,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,240
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51b_goodG2BSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98702/CWE400_Resource_Exhaustion__fgets_fwrite_51b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_51b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51b_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_004014f8,&UNK_00401507);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401510,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,241
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51b_goodB2GSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98702/CWE400_Resource_Exhaustion__fgets_fwrite_51b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_51b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_51b_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_00401543,&UNK_00401507);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401510,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
54,242
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_52b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401414);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_52b_badSink(uStack_c);
return;
}
|
['gcc']
|
54,243
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,244
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52b_badSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_52c_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52b_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_52c_badSink(param_1);
return;
}
|
['gcc']
|
54,245
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52b_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52b_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,246
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52b_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52b_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,247
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52c_badSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52c_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52c_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401430,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,248
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodG2BSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401528,&UNK_00401537);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401540,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,249
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodB2GSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98703/CWE400_Resource_Exhaustion__fgets_fwrite_52c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_52c_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_00401573,&UNK_00401537);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401540,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
54,250
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_53b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401434);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_53b_badSink(uStack_c);
return;
}
|
['gcc']
|
54,251
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,252
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53b_badSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53c_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53b_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53c_badSink(param_1);
return;
}
|
['gcc']
|
54,253
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53b_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53b_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,254
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53b_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53b_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,255
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53c_badSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53d_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53c_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53c_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53d_badSink(param_1);
return;
}
|
['gcc']
|
54,256
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,257
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53c_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,258
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53d_badSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53d.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53d_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53d_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401438,&UNK_00401447);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401450,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,259
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodG2BSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53d.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401558,&UNK_00401567);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401570,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,260
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodB2GSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98704/CWE400_Resource_Exhaustion__fgets_fwrite_53d.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_53d_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_004015a3,&UNK_00401567);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401570,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
54,261
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_54b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401444);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_54b_badSink(uStack_c);
return;
}
|
['gcc']
|
54,262
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,263
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54b_badSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54c_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54b_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54c_badSink(param_1);
return;
}
|
['gcc']
|
54,264
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54b_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54b_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,265
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54b_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54b_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,266
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54c_badSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54d_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54c_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54c_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54d_badSink(param_1);
return;
}
|
['gcc']
|
54,267
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,268
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54c.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54c_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,269
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54d_badSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54e_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54d.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54d_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54d_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54e_badSink(param_1);
return;
}
|
['gcc']
|
54,270
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54d.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,271
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54d.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54d_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,272
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54e_badSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54e.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54e_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54e_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401448,&UNK_00401457);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401460,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,273
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodG2BSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54e.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401588,&UNK_00401597);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_004015a0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,274
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodB2GSink(int count)
{
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98705/CWE400_Resource_Exhaustion__fgets_fwrite_54e.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_54e_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_004015d3,&UNK_00401597);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_004015a0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
54,275
|
void CWE400_Resource_Exhaustion__fgets_fwrite_61_bad()
{
int count;
/* Initialize count */
count = -1;
count = CWE400_Resource_Exhaustion__fgets_fwrite_61b_badSource(count);
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98706/CWE400_Resource_Exhaustion__fgets_fwrite_61a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_61_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_61_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = CWE400_Resource_Exhaustion__fgets_fwrite_61b_badSource(0xffffffff);
lVar2 = func_0x00400c40(&UNK_00401408,&UNK_00401417);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401420,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,276
|
void CWE400_Resource_Exhaustion__fgets_fwrite_61_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98706/CWE400_Resource_Exhaustion__fgets_fwrite_61a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_61_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_61_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,277
|
int CWE400_Resource_Exhaustion__fgets_fwrite_61b_badSource(int count)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
return count;
}
|
['/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98706/CWE400_Resource_Exhaustion__fgets_fwrite_61b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_61b_badSource
|
undefined4 CWE400_Resource_Exhaustion__fgets_fwrite_61b_badSource(undefined4 param_1)
{
long lVar1;
undefined4 uStack_1c;
undefined8 uStack_16;
undefined4 uStack_e;
undefined2 uStack_a;
uStack_16 = 0;
uStack_e = 0;
uStack_a = 0;
lVar1 = func_0x00400be0(&uStack_16,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401404);
uStack_1c = param_1;
}
else {
uStack_1c = func_0x00400c50(&uStack_16);
}
return uStack_1c;
}
|
['gcc']
|
54,278
|
int CWE400_Resource_Exhaustion__fgets_fwrite_61b_goodG2BSource(int count)
{
/* FIX: Use a relatively small number */
count = 20;
return count;
}
|
['/* FIX: Use a relatively small number */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98706/CWE400_Resource_Exhaustion__fgets_fwrite_61b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_61b_goodG2BSource
|
undefined4 CWE400_Resource_Exhaustion__fgets_fwrite_61b_goodG2BSource(void)
{
return 0x14;
}
|
['gcc']
|
54,279
|
int CWE400_Resource_Exhaustion__fgets_fwrite_61b_goodB2GSource(int count)
{
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
return count;
}
|
['/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98706/CWE400_Resource_Exhaustion__fgets_fwrite_61b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_61b_goodB2GSource
|
undefined4 CWE400_Resource_Exhaustion__fgets_fwrite_61b_goodB2GSource(undefined4 param_1)
{
long lVar1;
undefined4 uStack_1c;
undefined8 uStack_16;
undefined4 uStack_e;
undefined2 uStack_a;
uStack_16 = 0;
uStack_e = 0;
uStack_a = 0;
lVar1 = func_0x00400be0(&uStack_16,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_004014f4);
uStack_1c = param_1;
}
else {
uStack_1c = func_0x00400c50(&uStack_16);
}
return uStack_1c;
}
|
['gcc']
|
54,280
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_63b_badSink(&count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98708/CWE400_Resource_Exhaustion__fgets_fwrite_63a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_63_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401404);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_63b_badSink(&uStack_c);
return;
}
|
['gcc']
|
54,281
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98708/CWE400_Resource_Exhaustion__fgets_fwrite_63a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_63_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,282
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63b_badSink(int * countPtr)
{
int count = *countPtr;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98708/CWE400_Resource_Exhaustion__fgets_fwrite_63b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_63b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63b_badSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400c40(&UNK_00401408,&UNK_00401417);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401420,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,283
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63b_goodG2BSink(int * countPtr)
{
int count = *countPtr;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98708/CWE400_Resource_Exhaustion__fgets_fwrite_63b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_63b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63b_goodG2BSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400c40(&UNK_00401508,&UNK_00401517);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401520,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,284
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63b_goodB2GSink(int * countPtr)
{
int count = *countPtr;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98708/CWE400_Resource_Exhaustion__fgets_fwrite_63b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_63b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_63b_goodB2GSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
if ((0 < iVar1) && (iVar1 < 0x15)) {
lVar2 = func_0x00400c40(&UNK_00401553,&UNK_00401517);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401520,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
}
return;
}
|
['gcc']
|
54,285
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64_bad()
{
int count;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
CWE400_Resource_Exhaustion__fgets_fwrite_64b_badSink(&count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98709/CWE400_Resource_Exhaustion__fgets_fwrite_64a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_64_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64_bad(void)
{
long lVar1;
undefined8 uStack_1a;
undefined4 uStack_12;
undefined2 uStack_e;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1a = 0;
uStack_12 = 0;
uStack_e = 0;
lVar1 = func_0x00400be0(&uStack_1a,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401414);
}
else {
uStack_c = func_0x00400c50(&uStack_1a);
}
CWE400_Resource_Exhaustion__fgets_fwrite_64b_badSink(&uStack_c);
return;
}
|
['gcc']
|
54,286
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98709/CWE400_Resource_Exhaustion__fgets_fwrite_64a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_64_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,287
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64b_badSink(void * countVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
int * countPtr = (int *)countVoidPtr;
/* dereference countPtr into count */
int count = (*countPtr);
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference countPtr into count */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98709/CWE400_Resource_Exhaustion__fgets_fwrite_64b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_64b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64b_badSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401430,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,288
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64b_goodG2BSink(void * countVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
int * countPtr = (int *)countVoidPtr;
/* dereference countPtr into count */
int count = (*countPtr);
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference countPtr into count */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98709/CWE400_Resource_Exhaustion__fgets_fwrite_64b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_64b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64b_goodG2BSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400c40(&UNK_00401518,&UNK_00401527);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401530,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,289
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64b_goodB2GSink(void * countVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
int * countPtr = (int *)countVoidPtr;
/* dereference countPtr into count */
int count = (*countPtr);
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference countPtr into count */', '/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98709/CWE400_Resource_Exhaustion__fgets_fwrite_64b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_64b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_64b_goodB2GSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
if ((0 < iVar1) && (iVar1 < 0x15)) {
lVar2 = func_0x00400c40(&UNK_00401563,&UNK_00401527);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401530,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
}
return;
}
|
['gcc']
|
54,290
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66_bad()
{
int count;
int countArray[5];
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
/* put count in array */
countArray[2] = count;
CWE400_Resource_Exhaustion__fgets_fwrite_66b_badSink(countArray);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */', '/* put count in array */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98711/CWE400_Resource_Exhaustion__fgets_fwrite_66a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_66_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66_bad(void)
{
long lVar1;
undefined8 uStack_36;
undefined4 uStack_2e;
undefined2 uStack_2a;
undefined auStack_28 [8];
undefined4 uStack_20;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_36 = 0;
uStack_2e = 0;
uStack_2a = 0;
lVar1 = func_0x00400be0(&uStack_36,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401414);
}
else {
uStack_c = func_0x00400c50(&uStack_36);
}
uStack_20 = uStack_c;
CWE400_Resource_Exhaustion__fgets_fwrite_66b_badSink(auStack_28);
return;
}
|
['gcc']
|
54,291
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98711/CWE400_Resource_Exhaustion__fgets_fwrite_66a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_66_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,292
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66b_badSink(int countArray[])
{
/* copy count out of countArray */
int count = countArray[2];
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* copy count out of countArray */', '/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98711/CWE400_Resource_Exhaustion__fgets_fwrite_66b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_66b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66b_badSink(long param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *(int *)(param_1 + 8);
lVar2 = func_0x00400c40(&UNK_00401418,&UNK_00401427);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401430,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,293
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66b_goodG2BSink(int countArray[])
{
int count = countArray[2];
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98711/CWE400_Resource_Exhaustion__fgets_fwrite_66b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_66b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66b_goodG2BSink(long param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *(int *)(param_1 + 8);
lVar2 = func_0x00400c40(&UNK_00401518,&UNK_00401527);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401530,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
return;
}
|
['gcc']
|
54,294
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66b_goodB2GSink(int countArray[])
{
int count = countArray[2];
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98711/CWE400_Resource_Exhaustion__fgets_fwrite_66b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_66b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_66b_goodB2GSink(long param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *(int *)(param_1 + 8);
if ((0 < iVar1) && (iVar1 < 0x15)) {
lVar2 = func_0x00400c40(&UNK_00401563,&UNK_00401527);
if (lVar2 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400c70(&UNK_00401530,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar2 != 0) {
func_0x00400ba0(lVar2);
}
}
return;
}
|
['gcc']
|
54,295
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67_bad()
{
int count;
CWE400_Resource_Exhaustion__fgets_fwrite_67_structType myStruct;
/* Initialize count */
count = -1;
{
char inputBuffer[CHAR_ARRAY_SIZE] = "";
/* POTENTIAL FLAW: Read count from the console using fgets() */
if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
{
/* Convert to int */
count = atoi(inputBuffer);
}
else
{
printLine("fgets() failed.");
}
}
myStruct.structFirst = count;
CWE400_Resource_Exhaustion__fgets_fwrite_67b_badSink(myStruct);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Read count from the console using fgets() */', '/* Convert to int */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98712/CWE400_Resource_Exhaustion__fgets_fwrite_67a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_67_bad
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67_bad(void)
{
long lVar1;
undefined8 uStack_1e;
undefined4 uStack_16;
undefined2 uStack_12;
undefined4 uStack_10;
undefined4 uStack_c;
uStack_c = 0xffffffff;
uStack_1e = 0;
uStack_16 = 0;
uStack_12 = 0;
lVar1 = func_0x00400be0(&uStack_1e,0xe,stdin);
if (lVar1 == 0) {
printLine(&UNK_00401404);
}
else {
uStack_c = func_0x00400c50(&uStack_1e);
}
uStack_10 = uStack_c;
CWE400_Resource_Exhaustion__fgets_fwrite_67b_badSink(uStack_c);
return;
}
|
['gcc']
|
54,296
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98712/CWE400_Resource_Exhaustion__fgets_fwrite_67a.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_67_good
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,297
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67b_badSink(CWE400_Resource_Exhaustion__fgets_fwrite_67_structType myStruct)
{
int count = myStruct.structFirst;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98712/CWE400_Resource_Exhaustion__fgets_fwrite_67b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_67b_badSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67b_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401408,&UNK_00401417);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401420,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,298
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67b_goodG2BSink(CWE400_Resource_Exhaustion__fgets_fwrite_67_structType myStruct)
{
int count = myStruct.structFirst;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_bad.txt";
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
/* POTENTIAL FLAW: For loop using count as the loop variant and no validation
* This can cause a file to become very large */
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile))
{
exit(1);
}
}
if (pFile)
{
fclose(pFile);
}
}
}
|
['/* POTENTIAL FLAW: For loop using count as the loop variant and no validation\r\n * This can cause a file to become very large */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98712/CWE400_Resource_Exhaustion__fgets_fwrite_67b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_67b_goodG2BSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67b_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400c40(&UNK_00401508,&UNK_00401517);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401520,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
return;
}
|
['gcc']
|
54,299
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67b_goodB2GSink(CWE400_Resource_Exhaustion__fgets_fwrite_67_structType myStruct)
{
int count = myStruct.structFirst;
{
size_t i = 0;
FILE *pFile = NULL;
const char *filename = "output_good.txt";
/* FIX: Validate count before using it as the for loop variant to write to a file */
if (count > 0 && count <= 20)
{
pFile = fopen(filename, "w+");
if (pFile == NULL)
{
exit(1);
}
for (i = 0; i < (size_t)count; i++)
{
if (strlen(SENTENCE) != fwrite(SENTENCE, sizeof(char), strlen(SENTENCE), pFile)) exit(1);
}
if (pFile)
{
fclose(pFile);
}
}
}
}
|
['/* FIX: Validate count before using it as the for loop variant to write to a file */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/98712/CWE400_Resource_Exhaustion__fgets_fwrite_67b.c
|
CWE400_Resource_Exhaustion__fgets_fwrite_67b_goodB2GSink
|
void CWE400_Resource_Exhaustion__fgets_fwrite_67b_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400c40(&UNK_00401553,&UNK_00401517);
if (lVar1 == 0) {
func_0x00400c60(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400c70(&UNK_00401520,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400c60(1);
}
}
if (lVar1 != 0) {
func_0x00400ba0(lVar1);
}
}
return;
}
|
['gcc']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.