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,900
|
void CWE400_Resource_Exhaustion__rand_fwrite_22_goodB2G2Sink(int count)
{
if(CWE400_Resource_Exhaustion__rand_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/99124/CWE400_Resource_Exhaustion__rand_fwrite_22b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_22_goodB2G2Sink
|
void CWE400_Resource_Exhaustion__rand_fwrite_22_goodB2G2Sink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if (CWE400_Resource_Exhaustion__rand_fwrite_22_goodB2G2Global != 0) {
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400b40(&UNK_0040151d,&UNK_0040152d);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401530,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
}
return;
}
|
['gcc']
|
54,901
|
void CWE400_Resource_Exhaustion__rand_fwrite_22_goodG2BSink(int count)
{
if(CWE400_Resource_Exhaustion__rand_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/99124/CWE400_Resource_Exhaustion__rand_fwrite_22b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_22_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_22_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if (CWE400_Resource_Exhaustion__rand_fwrite_22_goodG2BGlobal != 0) {
lVar1 = func_0x00400b40(&UNK_00401563,&UNK_0040152d);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401530,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
return;
}
|
['gcc']
|
54,902
|
void CWE400_Resource_Exhaustion__rand_fwrite_31_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
{
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: Set count to a random value */', '/* 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/99125/CWE400_Resource_Exhaustion__rand_fwrite_31.c
|
CWE400_Resource_Exhaustion__rand_fwrite_31_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_31_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
long lVar4;
long lVar5;
ulong uStack_20;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
lVar4 = func_0x00400b40(&UNK_004012b8,&UNK_004012c7);
if (lVar4 == 0) {
func_0x00400b50(1);
}
for (uStack_20 = 0; uStack_20 < (ulong)(long)(int)(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
uStack_20 = uStack_20 + 1) {
lVar5 = func_0x00400b60(&UNK_004012d0,1,0x32,lVar4);
if (lVar5 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar4 != 0) {
func_0x00400ab0(lVar4);
}
return;
}
|
['gcc']
|
54,903
|
void CWE400_Resource_Exhaustion__rand_fwrite_31_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99125/CWE400_Resource_Exhaustion__rand_fwrite_31.c
|
CWE400_Resource_Exhaustion__rand_fwrite_31_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_31_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,904
|
void CWE400_Resource_Exhaustion__rand_fwrite_32_bad()
{
int count;
int *countPtr1 = &count;
int *countPtr2 = &count;
/* Initialize count */
count = -1;
{
int count = *countPtr1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
*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: Set count to a random value */', '/* 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/99126/CWE400_Resource_Exhaustion__rand_fwrite_32.c
|
CWE400_Resource_Exhaustion__rand_fwrite_32_bad
|
/* WARNING: Restarted to delay deadcode elimination for space: stack */
void CWE400_Resource_Exhaustion__rand_fwrite_32_bad(void)
{
int iVar1;
int iVar2;
long lVar3;
uint uStack_4c;
undefined *puStack_48;
long lStack_40;
uint uStack_38;
uint uStack_34;
uint *puStack_30;
uint *puStack_28;
ulong uStack_20;
puStack_28 = &uStack_4c;
puStack_30 = &uStack_4c;
uStack_4c = 0xffffffff;
uStack_34 = 0xffffffff;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uStack_34 = func_0x00400b70();
uStack_34 = uStack_34 ^ iVar1 << 0x1e ^ iVar2 << 0xf;
*puStack_28 = uStack_34;
uStack_38 = *puStack_30;
uStack_20 = 0;
lStack_40 = 0;
puStack_48 = &UNK_004012d8;
lStack_40 = func_0x00400b40(&UNK_004012d8,&UNK_004012e7);
if (lStack_40 == 0) {
func_0x00400b50(1);
}
for (uStack_20 = 0; uStack_20 < (ulong)(long)(int)uStack_38; uStack_20 = uStack_20 + 1) {
lVar3 = func_0x00400b60(&UNK_004012f0,1,0x32,lStack_40);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lStack_40 != 0) {
func_0x00400ab0(lStack_40);
}
return;
}
|
['gcc']
|
54,905
|
void CWE400_Resource_Exhaustion__rand_fwrite_32_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99126/CWE400_Resource_Exhaustion__rand_fwrite_32.c
|
CWE400_Resource_Exhaustion__rand_fwrite_32_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_32_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,906
|
void CWE400_Resource_Exhaustion__rand_fwrite_34_bad()
{
int count;
CWE400_Resource_Exhaustion__rand_fwrite_34_unionType myUnion;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
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: Set count to a random value */', '/* 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/99128/CWE400_Resource_Exhaustion__rand_fwrite_34.c
|
CWE400_Resource_Exhaustion__rand_fwrite_34_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_34_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
long lVar4;
long lVar5;
ulong uStack_20;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
lVar4 = func_0x00400b40(&UNK_004012b8,&UNK_004012c7);
if (lVar4 == 0) {
func_0x00400b50(1);
}
for (uStack_20 = 0; uStack_20 < (ulong)(long)(int)(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
uStack_20 = uStack_20 + 1) {
lVar5 = func_0x00400b60(&UNK_004012d0,1,0x32,lVar4);
if (lVar5 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar4 != 0) {
func_0x00400ab0(lVar4);
}
return;
}
|
['gcc']
|
54,907
|
void CWE400_Resource_Exhaustion__rand_fwrite_34_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99128/CWE400_Resource_Exhaustion__rand_fwrite_34.c
|
CWE400_Resource_Exhaustion__rand_fwrite_34_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_34_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,908
|
void CWE400_Resource_Exhaustion__rand_fwrite_41_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99129/CWE400_Resource_Exhaustion__rand_fwrite_41.c
|
CWE400_Resource_Exhaustion__rand_fwrite_41_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_41_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
badSink(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
return;
}
|
['gcc']
|
54,909
|
void CWE400_Resource_Exhaustion__rand_fwrite_41_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99129/CWE400_Resource_Exhaustion__rand_fwrite_41.c
|
CWE400_Resource_Exhaustion__rand_fwrite_41_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_41_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,910
|
void CWE400_Resource_Exhaustion__rand_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/99130/CWE400_Resource_Exhaustion__rand_fwrite_42.c
|
CWE400_Resource_Exhaustion__rand_fwrite_42_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_42_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = badSource(0xffffffff);
lVar2 = func_0x00400b40(&UNK_004012c8,&UNK_004012d7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004012e0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,911
|
void CWE400_Resource_Exhaustion__rand_fwrite_42_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99130/CWE400_Resource_Exhaustion__rand_fwrite_42.c
|
CWE400_Resource_Exhaustion__rand_fwrite_42_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_42_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,912
|
void CWE400_Resource_Exhaustion__rand_fwrite_51_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
CWE400_Resource_Exhaustion__rand_fwrite_51b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99134/CWE400_Resource_Exhaustion__rand_fwrite_51a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_51_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_51_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
CWE400_Resource_Exhaustion__rand_fwrite_51b_badSink(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
return;
}
|
['gcc']
|
54,913
|
void CWE400_Resource_Exhaustion__rand_fwrite_51_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99134/CWE400_Resource_Exhaustion__rand_fwrite_51a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_51_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_51_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,914
|
void CWE400_Resource_Exhaustion__rand_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/99134/CWE400_Resource_Exhaustion__rand_fwrite_51b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_51b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_51b_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004012c8,&UNK_004012d7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_004012e0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,915
|
void CWE400_Resource_Exhaustion__rand_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/99134/CWE400_Resource_Exhaustion__rand_fwrite_51b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_51b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_51b_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004013b8,&UNK_004013c7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_004013d0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,916
|
void CWE400_Resource_Exhaustion__rand_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/99134/CWE400_Resource_Exhaustion__rand_fwrite_51b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_51b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_51b_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400b40(&UNK_00401403,&UNK_004013c7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_004013d0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
return;
}
|
['gcc']
|
54,917
|
void CWE400_Resource_Exhaustion__rand_fwrite_52_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
CWE400_Resource_Exhaustion__rand_fwrite_52b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99135/CWE400_Resource_Exhaustion__rand_fwrite_52a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_52_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
CWE400_Resource_Exhaustion__rand_fwrite_52b_badSink(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
return;
}
|
['gcc']
|
54,918
|
void CWE400_Resource_Exhaustion__rand_fwrite_52_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99135/CWE400_Resource_Exhaustion__rand_fwrite_52a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_52_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,919
|
void CWE400_Resource_Exhaustion__rand_fwrite_52b_badSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_52c_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99135/CWE400_Resource_Exhaustion__rand_fwrite_52b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_52b_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_52c_badSink(param_1);
return;
}
|
['gcc']
|
54,920
|
void CWE400_Resource_Exhaustion__rand_fwrite_52b_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_52c_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99135/CWE400_Resource_Exhaustion__rand_fwrite_52b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_52b_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_52c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,921
|
void CWE400_Resource_Exhaustion__rand_fwrite_52b_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_52c_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99135/CWE400_Resource_Exhaustion__rand_fwrite_52b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_52b_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_52c_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,922
|
void CWE400_Resource_Exhaustion__rand_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/99135/CWE400_Resource_Exhaustion__rand_fwrite_52c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52c_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_52c_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004012e8,&UNK_004012f7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401300,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,923
|
void CWE400_Resource_Exhaustion__rand_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/99135/CWE400_Resource_Exhaustion__rand_fwrite_52c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52c_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_52c_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004013e8,&UNK_004013f7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401400,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,924
|
void CWE400_Resource_Exhaustion__rand_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/99135/CWE400_Resource_Exhaustion__rand_fwrite_52c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_52c_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_52c_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400b40(&UNK_00401433,&UNK_004013f7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401400,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
return;
}
|
['gcc']
|
54,925
|
void CWE400_Resource_Exhaustion__rand_fwrite_53_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
CWE400_Resource_Exhaustion__rand_fwrite_53b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_53_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
CWE400_Resource_Exhaustion__rand_fwrite_53b_badSink(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
return;
}
|
['gcc']
|
54,926
|
void CWE400_Resource_Exhaustion__rand_fwrite_53_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_53_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,927
|
void CWE400_Resource_Exhaustion__rand_fwrite_53b_badSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_53c_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53b_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_53c_badSink(param_1);
return;
}
|
['gcc']
|
54,928
|
void CWE400_Resource_Exhaustion__rand_fwrite_53b_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_53c_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53b_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_53c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,929
|
void CWE400_Resource_Exhaustion__rand_fwrite_53b_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_53c_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53b_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_53c_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,930
|
void CWE400_Resource_Exhaustion__rand_fwrite_53c_badSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_53d_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53c_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53c_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_53d_badSink(param_1);
return;
}
|
['gcc']
|
54,931
|
void CWE400_Resource_Exhaustion__rand_fwrite_53c_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_53d_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53c_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53c_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_53d_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,932
|
void CWE400_Resource_Exhaustion__rand_fwrite_53c_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_53d_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99136/CWE400_Resource_Exhaustion__rand_fwrite_53c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53c_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53c_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_53d_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,933
|
void CWE400_Resource_Exhaustion__rand_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/99136/CWE400_Resource_Exhaustion__rand_fwrite_53d.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53d_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53d_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004012f8,&UNK_00401307);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401310,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,934
|
void CWE400_Resource_Exhaustion__rand_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/99136/CWE400_Resource_Exhaustion__rand_fwrite_53d.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53d_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53d_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_00401418,&UNK_00401427);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401430,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,935
|
void CWE400_Resource_Exhaustion__rand_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/99136/CWE400_Resource_Exhaustion__rand_fwrite_53d.c
|
CWE400_Resource_Exhaustion__rand_fwrite_53d_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_53d_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400b40(&UNK_00401463,&UNK_00401427);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401430,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
return;
}
|
['gcc']
|
54,936
|
void CWE400_Resource_Exhaustion__rand_fwrite_54_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
CWE400_Resource_Exhaustion__rand_fwrite_54b_badSink(count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_54_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
CWE400_Resource_Exhaustion__rand_fwrite_54b_badSink(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
return;
}
|
['gcc']
|
54,937
|
void CWE400_Resource_Exhaustion__rand_fwrite_54_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_54_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,938
|
void CWE400_Resource_Exhaustion__rand_fwrite_54b_badSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54c_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54b_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54c_badSink(param_1);
return;
}
|
['gcc']
|
54,939
|
void CWE400_Resource_Exhaustion__rand_fwrite_54b_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54c_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54b_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54c_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,940
|
void CWE400_Resource_Exhaustion__rand_fwrite_54b_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54c_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54b_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54c_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,941
|
void CWE400_Resource_Exhaustion__rand_fwrite_54c_badSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54d_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54c_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54c_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54d_badSink(param_1);
return;
}
|
['gcc']
|
54,942
|
void CWE400_Resource_Exhaustion__rand_fwrite_54c_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54d_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54c_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54c_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54d_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,943
|
void CWE400_Resource_Exhaustion__rand_fwrite_54c_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54d_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54c.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54c_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54c_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54d_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,944
|
void CWE400_Resource_Exhaustion__rand_fwrite_54d_badSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54e_badSink(count);
}
|
[]
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54d.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54d_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54d_badSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54e_badSink(param_1);
return;
}
|
['gcc']
|
54,945
|
void CWE400_Resource_Exhaustion__rand_fwrite_54d_goodG2BSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54e_goodG2BSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54d.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54d_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54d_goodG2BSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54e_goodG2BSink(param_1);
return;
}
|
['gcc']
|
54,946
|
void CWE400_Resource_Exhaustion__rand_fwrite_54d_goodB2GSink(int count)
{
CWE400_Resource_Exhaustion__rand_fwrite_54e_goodB2GSink(count);
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99137/CWE400_Resource_Exhaustion__rand_fwrite_54d.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54d_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54d_goodB2GSink(undefined4 param_1)
{
CWE400_Resource_Exhaustion__rand_fwrite_54e_goodB2GSink(param_1);
return;
}
|
['gcc']
|
54,947
|
void CWE400_Resource_Exhaustion__rand_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/99137/CWE400_Resource_Exhaustion__rand_fwrite_54e.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54e_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54e_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_00401318,&UNK_00401327);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401330,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,948
|
void CWE400_Resource_Exhaustion__rand_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/99137/CWE400_Resource_Exhaustion__rand_fwrite_54e.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54e_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54e_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_00401448,&UNK_00401457);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401460,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,949
|
void CWE400_Resource_Exhaustion__rand_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/99137/CWE400_Resource_Exhaustion__rand_fwrite_54e.c
|
CWE400_Resource_Exhaustion__rand_fwrite_54e_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_54e_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400b40(&UNK_00401493,&UNK_00401457);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_00401460,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
return;
}
|
['gcc']
|
54,950
|
void CWE400_Resource_Exhaustion__rand_fwrite_61_bad()
{
int count;
/* Initialize count */
count = -1;
count = CWE400_Resource_Exhaustion__rand_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/99138/CWE400_Resource_Exhaustion__rand_fwrite_61a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_61_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_61_bad(void)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = CWE400_Resource_Exhaustion__rand_fwrite_61b_badSource(0xffffffff);
lVar2 = func_0x00400b40(&UNK_004012c8,&UNK_004012d7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004012e0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,951
|
void CWE400_Resource_Exhaustion__rand_fwrite_61_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99138/CWE400_Resource_Exhaustion__rand_fwrite_61a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_61_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_61_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,952
|
int CWE400_Resource_Exhaustion__rand_fwrite_61b_badSource(int count)
{
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
return count;
}
|
['/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99138/CWE400_Resource_Exhaustion__rand_fwrite_61b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_61b_badSource
|
uint CWE400_Resource_Exhaustion__rand_fwrite_61b_badSource(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
return uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf;
}
|
['gcc']
|
54,953
|
int CWE400_Resource_Exhaustion__rand_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/99138/CWE400_Resource_Exhaustion__rand_fwrite_61b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_61b_goodG2BSource
|
undefined4 CWE400_Resource_Exhaustion__rand_fwrite_61b_goodG2BSource(void)
{
return 0x14;
}
|
['gcc']
|
54,954
|
int CWE400_Resource_Exhaustion__rand_fwrite_61b_goodB2GSource(int count)
{
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
return count;
}
|
['/* POTENTIAL FLAW: Set count to a random value */']
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99138/CWE400_Resource_Exhaustion__rand_fwrite_61b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_61b_goodB2GSource
|
uint CWE400_Resource_Exhaustion__rand_fwrite_61b_goodB2GSource(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
return uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf;
}
|
['gcc']
|
54,955
|
void CWE400_Resource_Exhaustion__rand_fwrite_63_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
CWE400_Resource_Exhaustion__rand_fwrite_63b_badSink(&count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99140/CWE400_Resource_Exhaustion__rand_fwrite_63a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_63_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_63_bad(void)
{
int iVar1;
int iVar2;
uint auStack_1c [3];
auStack_1c[0] = 0xffffffff;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
auStack_1c[0] = func_0x00400b70();
auStack_1c[0] = auStack_1c[0] ^ iVar1 << 0x1e ^ iVar2 << 0xf;
CWE400_Resource_Exhaustion__rand_fwrite_63b_badSink(auStack_1c);
return;
}
|
['gcc']
|
54,956
|
void CWE400_Resource_Exhaustion__rand_fwrite_63_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99140/CWE400_Resource_Exhaustion__rand_fwrite_63a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_63_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_63_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,957
|
void CWE400_Resource_Exhaustion__rand_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/99140/CWE400_Resource_Exhaustion__rand_fwrite_63b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_63b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_63b_badSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400b40(&UNK_004012d8,&UNK_004012e7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004012f0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,958
|
void CWE400_Resource_Exhaustion__rand_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/99140/CWE400_Resource_Exhaustion__rand_fwrite_63b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_63b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_63b_goodG2BSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400b40(&UNK_004013d8,&UNK_004013e7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004013f0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,959
|
void CWE400_Resource_Exhaustion__rand_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/99140/CWE400_Resource_Exhaustion__rand_fwrite_63b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_63b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_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_0x00400b40(&UNK_00401423,&UNK_004013e7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004013f0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
}
return;
}
|
['gcc']
|
54,960
|
void CWE400_Resource_Exhaustion__rand_fwrite_64_bad()
{
int count;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
CWE400_Resource_Exhaustion__rand_fwrite_64b_badSink(&count);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99141/CWE400_Resource_Exhaustion__rand_fwrite_64a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_64_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_64_bad(void)
{
int iVar1;
int iVar2;
uint auStack_1c [3];
auStack_1c[0] = 0xffffffff;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
auStack_1c[0] = func_0x00400b70();
auStack_1c[0] = auStack_1c[0] ^ iVar1 << 0x1e ^ iVar2 << 0xf;
CWE400_Resource_Exhaustion__rand_fwrite_64b_badSink(auStack_1c);
return;
}
|
['gcc']
|
54,961
|
void CWE400_Resource_Exhaustion__rand_fwrite_64_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99141/CWE400_Resource_Exhaustion__rand_fwrite_64a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_64_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_64_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,962
|
void CWE400_Resource_Exhaustion__rand_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/99141/CWE400_Resource_Exhaustion__rand_fwrite_64b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_64b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_64b_badSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400b40(&UNK_004012d8,&UNK_004012e7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004012f0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,963
|
void CWE400_Resource_Exhaustion__rand_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/99141/CWE400_Resource_Exhaustion__rand_fwrite_64b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_64b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_64b_goodG2BSink(int *param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *param_1;
lVar2 = func_0x00400b40(&UNK_004013e8,&UNK_004013f7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_00401400,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,964
|
void CWE400_Resource_Exhaustion__rand_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/99141/CWE400_Resource_Exhaustion__rand_fwrite_64b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_64b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_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_0x00400b40(&UNK_00401433,&UNK_004013f7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_00401400,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
}
return;
}
|
['gcc']
|
54,965
|
void CWE400_Resource_Exhaustion__rand_fwrite_66_bad()
{
int count;
int countArray[5];
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
/* put count in array */
countArray[2] = count;
CWE400_Resource_Exhaustion__rand_fwrite_66b_badSink(countArray);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */', '/* put count in array */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99143/CWE400_Resource_Exhaustion__rand_fwrite_66a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_66_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_66_bad(void)
{
int iVar1;
int iVar2;
undefined auStack_38 [8];
uint uStack_30;
uint uStack_1c;
uStack_1c = 0xffffffff;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uStack_30 = func_0x00400b70();
uStack_30 = uStack_30 ^ iVar1 << 0x1e ^ iVar2 << 0xf;
uStack_1c = uStack_30;
CWE400_Resource_Exhaustion__rand_fwrite_66b_badSink(auStack_38);
return;
}
|
['gcc']
|
54,966
|
void CWE400_Resource_Exhaustion__rand_fwrite_66_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99143/CWE400_Resource_Exhaustion__rand_fwrite_66a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_66_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_66_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,967
|
void CWE400_Resource_Exhaustion__rand_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/99143/CWE400_Resource_Exhaustion__rand_fwrite_66b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_66b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_66b_badSink(long param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *(int *)(param_1 + 8);
lVar2 = func_0x00400b40(&UNK_004012d8,&UNK_004012e7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_004012f0,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,968
|
void CWE400_Resource_Exhaustion__rand_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/99143/CWE400_Resource_Exhaustion__rand_fwrite_66b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_66b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_66b_goodG2BSink(long param_1)
{
int iVar1;
long lVar2;
long lVar3;
ulong uStack_10;
iVar1 = *(int *)(param_1 + 8);
lVar2 = func_0x00400b40(&UNK_004013e8,&UNK_004013f7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_00401400,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
return;
}
|
['gcc']
|
54,969
|
void CWE400_Resource_Exhaustion__rand_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/99143/CWE400_Resource_Exhaustion__rand_fwrite_66b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_66b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_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_0x00400b40(&UNK_00401433,&UNK_004013f7);
if (lVar2 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)iVar1; uStack_10 = uStack_10 + 1) {
lVar3 = func_0x00400b60(&UNK_00401400,1,0x32,lVar2);
if (lVar3 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar2 != 0) {
func_0x00400ab0(lVar2);
}
}
return;
}
|
['gcc']
|
54,970
|
void CWE400_Resource_Exhaustion__rand_fwrite_67_bad()
{
int count;
CWE400_Resource_Exhaustion__rand_fwrite_67_structType myStruct;
/* Initialize count */
count = -1;
/* POTENTIAL FLAW: Set count to a random value */
count = RAND32();
myStruct.structFirst = count;
CWE400_Resource_Exhaustion__rand_fwrite_67b_badSink(myStruct);
}
|
['/* Initialize count */', '/* POTENTIAL FLAW: Set count to a random value */']
|
['CWE400']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99144/CWE400_Resource_Exhaustion__rand_fwrite_67a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_67_bad
|
void CWE400_Resource_Exhaustion__rand_fwrite_67_bad(void)
{
int iVar1;
int iVar2;
uint uVar3;
iVar1 = func_0x00400b70();
iVar2 = func_0x00400b70();
uVar3 = func_0x00400b70();
CWE400_Resource_Exhaustion__rand_fwrite_67b_badSink(uVar3 ^ iVar1 << 0x1e ^ iVar2 << 0xf);
return;
}
|
['gcc']
|
54,971
|
void CWE400_Resource_Exhaustion__rand_fwrite_67_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99144/CWE400_Resource_Exhaustion__rand_fwrite_67a.c
|
CWE400_Resource_Exhaustion__rand_fwrite_67_good
|
void CWE400_Resource_Exhaustion__rand_fwrite_67_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,972
|
void CWE400_Resource_Exhaustion__rand_fwrite_67b_badSink(CWE400_Resource_Exhaustion__rand_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/99144/CWE400_Resource_Exhaustion__rand_fwrite_67b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_67b_badSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_67b_badSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004012d8,&UNK_004012e7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_004012f0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,973
|
void CWE400_Resource_Exhaustion__rand_fwrite_67b_goodG2BSink(CWE400_Resource_Exhaustion__rand_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/99144/CWE400_Resource_Exhaustion__rand_fwrite_67b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_67b_goodG2BSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_67b_goodG2BSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
lVar1 = func_0x00400b40(&UNK_004013d8,&UNK_004013e7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_004013f0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
return;
}
|
['gcc']
|
54,974
|
void CWE400_Resource_Exhaustion__rand_fwrite_67b_goodB2GSink(CWE400_Resource_Exhaustion__rand_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/99144/CWE400_Resource_Exhaustion__rand_fwrite_67b.c
|
CWE400_Resource_Exhaustion__rand_fwrite_67b_goodB2GSink
|
void CWE400_Resource_Exhaustion__rand_fwrite_67b_goodB2GSink(int param_1)
{
long lVar1;
long lVar2;
ulong uStack_10;
if ((0 < param_1) && (param_1 < 0x15)) {
lVar1 = func_0x00400b40(&UNK_00401423,&UNK_004013e7);
if (lVar1 == 0) {
func_0x00400b50(1);
}
for (uStack_10 = 0; uStack_10 < (ulong)(long)param_1; uStack_10 = uStack_10 + 1) {
lVar2 = func_0x00400b60(&UNK_004013f0,1,0x32,lVar1);
if (lVar2 != 0x32) {
func_0x00400b50(1);
}
}
if (lVar1 != 0) {
func_0x00400ab0(lVar1);
}
}
return;
}
|
['gcc']
|
54,975
|
void CWE401_Memory_Leak__char_calloc_01_bad()
{
char * data;
data = NULL;
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99201/CWE401_Memory_Leak__char_calloc_01.c
|
CWE401_Memory_Leak__char_calloc_01_bad
|
void CWE401_Memory_Leak__char_calloc_01_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
return;
}
|
['gcc']
|
54,976
|
void CWE401_Memory_Leak__char_calloc_01_good()
{
goodG2B();
goodB2G();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99201/CWE401_Memory_Leak__char_calloc_01.c
|
CWE401_Memory_Leak__char_calloc_01_good
|
void CWE401_Memory_Leak__char_calloc_01_good(void)
{
goodG2B();
goodB2G();
return;
}
|
['gcc']
|
54,977
|
void CWE401_Memory_Leak__char_calloc_02_bad()
{
char * data;
data = NULL;
if(1)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(1)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99202/CWE401_Memory_Leak__char_calloc_02.c
|
CWE401_Memory_Leak__char_calloc_02_bad
|
void CWE401_Memory_Leak__char_calloc_02_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
return;
}
|
['gcc']
|
54,978
|
void CWE401_Memory_Leak__char_calloc_02_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99202/CWE401_Memory_Leak__char_calloc_02.c
|
CWE401_Memory_Leak__char_calloc_02_good
|
void CWE401_Memory_Leak__char_calloc_02_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,979
|
void CWE401_Memory_Leak__char_calloc_03_bad()
{
char * data;
data = NULL;
if(5==5)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(5==5)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99203/CWE401_Memory_Leak__char_calloc_03.c
|
CWE401_Memory_Leak__char_calloc_03_bad
|
void CWE401_Memory_Leak__char_calloc_03_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
return;
}
|
['gcc']
|
54,980
|
void CWE401_Memory_Leak__char_calloc_03_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99203/CWE401_Memory_Leak__char_calloc_03.c
|
CWE401_Memory_Leak__char_calloc_03_good
|
void CWE401_Memory_Leak__char_calloc_03_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,981
|
void CWE401_Memory_Leak__char_calloc_04_bad()
{
char * data;
data = NULL;
if(STATIC_CONST_TRUE)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(STATIC_CONST_TRUE)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99204/CWE401_Memory_Leak__char_calloc_04.c
|
CWE401_Memory_Leak__char_calloc_04_bad
|
void CWE401_Memory_Leak__char_calloc_04_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
return;
}
|
['gcc']
|
54,982
|
void CWE401_Memory_Leak__char_calloc_04_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99204/CWE401_Memory_Leak__char_calloc_04.c
|
CWE401_Memory_Leak__char_calloc_04_good
|
void CWE401_Memory_Leak__char_calloc_04_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,983
|
void CWE401_Memory_Leak__char_calloc_05_bad()
{
char * data;
data = NULL;
if(staticTrue)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(staticTrue)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99205/CWE401_Memory_Leak__char_calloc_05.c
|
CWE401_Memory_Leak__char_calloc_05_bad
|
void CWE401_Memory_Leak__char_calloc_05_bad(void)
{
undefined8 *puVar1;
if (staticTrue != 0) {
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
}
return;
}
|
['gcc']
|
54,984
|
void CWE401_Memory_Leak__char_calloc_05_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99205/CWE401_Memory_Leak__char_calloc_05.c
|
CWE401_Memory_Leak__char_calloc_05_good
|
void CWE401_Memory_Leak__char_calloc_05_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,985
|
void CWE401_Memory_Leak__char_calloc_06_bad()
{
char * data;
data = NULL;
if(STATIC_CONST_FIVE==5)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(STATIC_CONST_FIVE==5)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99206/CWE401_Memory_Leak__char_calloc_06.c
|
CWE401_Memory_Leak__char_calloc_06_bad
|
void CWE401_Memory_Leak__char_calloc_06_bad(void)
{
undefined8 *puVar1;
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
return;
}
|
['gcc']
|
54,986
|
void CWE401_Memory_Leak__char_calloc_06_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99206/CWE401_Memory_Leak__char_calloc_06.c
|
CWE401_Memory_Leak__char_calloc_06_good
|
void CWE401_Memory_Leak__char_calloc_06_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,987
|
void CWE401_Memory_Leak__char_calloc_07_bad()
{
char * data;
data = NULL;
if(staticFive==5)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(staticFive==5)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99207/CWE401_Memory_Leak__char_calloc_07.c
|
CWE401_Memory_Leak__char_calloc_07_bad
|
void CWE401_Memory_Leak__char_calloc_07_bad(void)
{
undefined8 *puVar1;
if (staticFive == 5) {
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
}
return;
}
|
['gcc']
|
54,988
|
void CWE401_Memory_Leak__char_calloc_07_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99207/CWE401_Memory_Leak__char_calloc_07.c
|
CWE401_Memory_Leak__char_calloc_07_good
|
void CWE401_Memory_Leak__char_calloc_07_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,989
|
void CWE401_Memory_Leak__char_calloc_08_bad()
{
char * data;
data = NULL;
if(staticReturnsTrue())
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(staticReturnsTrue())
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99208/CWE401_Memory_Leak__char_calloc_08.c
|
CWE401_Memory_Leak__char_calloc_08_bad
|
void CWE401_Memory_Leak__char_calloc_08_bad(void)
{
int iVar1;
undefined8 *puVar2;
iVar1 = staticReturnsTrue();
if (iVar1 != 0) {
puVar2 = (undefined8 *)func_0x00400a40(100,1);
*puVar2 = 0x676e697274532041;
*(undefined *)(puVar2 + 1) = 0;
printLine(puVar2);
}
staticReturnsTrue();
return;
}
|
['gcc']
|
54,990
|
void CWE401_Memory_Leak__char_calloc_08_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99208/CWE401_Memory_Leak__char_calloc_08.c
|
CWE401_Memory_Leak__char_calloc_08_good
|
void CWE401_Memory_Leak__char_calloc_08_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,991
|
void CWE401_Memory_Leak__char_calloc_09_bad()
{
char * data;
data = NULL;
if(GLOBAL_CONST_TRUE)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(GLOBAL_CONST_TRUE)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99209/CWE401_Memory_Leak__char_calloc_09.c
|
CWE401_Memory_Leak__char_calloc_09_bad
|
void CWE401_Memory_Leak__char_calloc_09_bad(void)
{
undefined8 *puVar1;
if (GLOBAL_CONST_TRUE != 0) {
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
}
return;
}
|
['gcc']
|
54,992
|
void CWE401_Memory_Leak__char_calloc_09_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99209/CWE401_Memory_Leak__char_calloc_09.c
|
CWE401_Memory_Leak__char_calloc_09_good
|
void CWE401_Memory_Leak__char_calloc_09_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,993
|
void CWE401_Memory_Leak__char_calloc_10_bad()
{
char * data;
data = NULL;
if(globalTrue)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(globalTrue)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99210/CWE401_Memory_Leak__char_calloc_10.c
|
CWE401_Memory_Leak__char_calloc_10_bad
|
void CWE401_Memory_Leak__char_calloc_10_bad(void)
{
undefined8 *puVar1;
if (globalTrue != 0) {
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
}
return;
}
|
['gcc']
|
54,994
|
void CWE401_Memory_Leak__char_calloc_10_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99210/CWE401_Memory_Leak__char_calloc_10.c
|
CWE401_Memory_Leak__char_calloc_10_good
|
void CWE401_Memory_Leak__char_calloc_10_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,995
|
void CWE401_Memory_Leak__char_calloc_11_bad()
{
char * data;
data = NULL;
if(globalReturnsTrue())
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(globalReturnsTrue())
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99211/CWE401_Memory_Leak__char_calloc_11.c
|
CWE401_Memory_Leak__char_calloc_11_bad
|
void CWE401_Memory_Leak__char_calloc_11_bad(void)
{
int iVar1;
undefined8 *puVar2;
iVar1 = globalReturnsTrue();
if (iVar1 != 0) {
puVar2 = (undefined8 *)func_0x00400a40(100,1);
*puVar2 = 0x676e697274532041;
*(undefined *)(puVar2 + 1) = 0;
printLine(puVar2);
}
globalReturnsTrue();
return;
}
|
['gcc']
|
54,996
|
void CWE401_Memory_Leak__char_calloc_11_good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99211/CWE401_Memory_Leak__char_calloc_11.c
|
CWE401_Memory_Leak__char_calloc_11_good
|
void CWE401_Memory_Leak__char_calloc_11_good(void)
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
return;
}
|
['gcc']
|
54,997
|
void CWE401_Memory_Leak__char_calloc_12_bad()
{
char * data;
data = NULL;
if(globalReturnsTrueOrFalse())
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
else
{
/* FIX: Use memory allocated on the stack with ALLOCA */
data = (char *)ALLOCA(100*sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(globalReturnsTrueOrFalse())
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
else
{
/* FIX: Deallocate memory */
free(data);
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* FIX: Use memory allocated on the stack with ALLOCA */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */', '/* FIX: Deallocate memory */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99212/CWE401_Memory_Leak__char_calloc_12.c
|
CWE401_Memory_Leak__char_calloc_12_bad
|
void CWE401_Memory_Leak__char_calloc_12_bad(void)
{
int iVar1;
undefined *puVar2;
undefined auStack_88 [8];
undefined8 uStack_80;
undefined uStack_78;
undefined *puStack_20;
undefined auStack_18 [8];
undefined8 *puStack_10;
puVar2 = auStack_18;
puStack_10 = (undefined8 *)0x0;
puStack_20 = &UNK_00400bec;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
puVar2 = auStack_88;
puStack_10 = &uStack_80;
uStack_80 = 0x676e697274532041;
uStack_78 = 0;
printLine(puStack_10);
}
else {
puStack_20 = &UNK_00400bff;
puStack_10 = (undefined8 *)func_0x00400a90(100,1);
*puStack_10 = 0x676e697274532041;
*(undefined *)(puStack_10 + 1) = 0;
puStack_20 = &UNK_00400c24;
printLine(puStack_10);
}
*(undefined **)(puVar2 + -8) = &UNK_00400c85;
iVar1 = globalReturnsTrueOrFalse();
if (iVar1 == 0) {
*(undefined **)(puVar2 + -8) = &UNK_00400c95;
func_0x00400a20(puStack_10);
}
return;
}
|
['gcc']
|
54,998
|
void CWE401_Memory_Leak__char_calloc_12_good()
{
goodB2G();
goodG2B();
}
|
[]
| null |
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99212/CWE401_Memory_Leak__char_calloc_12.c
|
CWE401_Memory_Leak__char_calloc_12_good
|
void CWE401_Memory_Leak__char_calloc_12_good(void)
{
goodB2G();
goodG2B();
return;
}
|
['gcc']
|
54,999
|
void CWE401_Memory_Leak__char_calloc_13_bad()
{
char * data;
data = NULL;
if(GLOBAL_CONST_FIVE==5)
{
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (char *)calloc(100, sizeof(char));
/* Initialize and make use of data */
strcpy(data, "A String");
printLine(data);
}
if(GLOBAL_CONST_FIVE==5)
{
/* POTENTIAL FLAW: No deallocation */
; /* empty statement needed for some flow variants */
}
}
|
['/* POTENTIAL FLAW: Allocate memory on the heap */', '/* Initialize and make use of data */', '/* POTENTIAL FLAW: No deallocation */', '/* empty statement needed for some flow variants */']
|
['CWE401']
|
mvd
|
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/99213/CWE401_Memory_Leak__char_calloc_13.c
|
CWE401_Memory_Leak__char_calloc_13_bad
|
void CWE401_Memory_Leak__char_calloc_13_bad(void)
{
undefined8 *puVar1;
if (GLOBAL_CONST_FIVE == 5) {
puVar1 = (undefined8 *)func_0x00400a40(100,1);
*puVar1 = 0x676e697274532041;
*(undefined *)(puVar1 + 1) = 0;
printLine(puVar1);
}
return;
}
|
['gcc']
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.