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
13,500
void CWE78_OS_Command_Injection__char_file_execlp_66_bad() { char * data; char * dataArray[5]; char dataBuffer[100] = ""; data = dataBuffer; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } /* put data in array */ dataArray[2] = data; CWE78_OS_Command_Injection__char_file_execlp_66b_badSink(dataArray); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* put data in array */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119469/CWE78_OS_Command_Injection__char_file_execlp_66a.c
CWE78_OS_Command_Injection__char_file_execlp_66_bad
void CWE78_OS_Command_Injection__char_file_execlp_66_bad(void) { long lVar1; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined auStack_48 [16]; undefined8 *puStack_38; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_b8 = 0; uStack_b0 = 0; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; puStack_10 = &uStack_b8; lStack_18 = func_0x00400b40(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400be0(&UNK_004013e6,&UNK_004013e4); if (lStack_20 != 0) { lVar1 = func_0x00400b80((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_004013f4); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b30(lStack_20); } } puStack_38 = puStack_10; CWE78_OS_Command_Injection__char_file_execlp_66b_badSink(auStack_48); return; }
['gcc']
13,501
void CWE78_OS_Command_Injection__char_file_execlp_66_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119469/CWE78_OS_Command_Injection__char_file_execlp_66a.c
CWE78_OS_Command_Injection__char_file_execlp_66_good
void CWE78_OS_Command_Injection__char_file_execlp_66_good(void) { goodG2B(); return; }
['gcc']
13,502
void CWE78_OS_Command_Injection__char_file_execlp_66b_badSink(char * dataArray[]) { /* copy data out of dataArray */ char * data = dataArray[2]; /* execlp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL); }
['/* copy data out of dataArray */', '/* execlp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119469/CWE78_OS_Command_Injection__char_file_execlp_66b.c
CWE78_OS_Command_Injection__char_file_execlp_66b_badSink
void CWE78_OS_Command_Injection__char_file_execlp_66b_badSink(long param_1) { func_0x00400bf0(&UNK_004013eb,&UNK_004013eb,&UNK_004013e8,&UNK_004013e4, *(undefined8 *)(param_1 + 0x10),0); return; }
['gcc']
13,503
void CWE78_OS_Command_Injection__char_file_execlp_66b_goodG2BSink(char * dataArray[]) { char * data = dataArray[2]; /* execlp - searches for the location of the command among * the directories specified by the PATH environment variable */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ EXECLP(COMMAND_INT, COMMAND_INT, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL); }
['/* execlp - searches for the location of the command among\r\n * the directories specified by the PATH environment variable */', '/* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119469/CWE78_OS_Command_Injection__char_file_execlp_66b.c
CWE78_OS_Command_Injection__char_file_execlp_66b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_execlp_66b_goodG2BSink(long param_1) { func_0x00400a80(&UNK_0040122b,&UNK_0040122b,&UNK_00401228,&UNK_00401224, *(undefined8 *)(param_1 + 0x10),0); return; }
['gcc']
13,504
void CWE78_OS_Command_Injection__char_file_popen_03_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(5==5) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119481/CWE78_OS_Command_Injection__char_file_popen_03.c
CWE78_OS_Command_Injection__char_file_popen_03_bad
void CWE78_OS_Command_Injection__char_file_popen_03_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_004013f6,&UNK_004013f4); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401404); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401413); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,505
void CWE78_OS_Command_Injection__char_file_popen_03_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119481/CWE78_OS_Command_Injection__char_file_popen_03.c
CWE78_OS_Command_Injection__char_file_popen_03_good
void CWE78_OS_Command_Injection__char_file_popen_03_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,506
void CWE78_OS_Command_Injection__char_file_popen_04_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(STATIC_CONST_TRUE) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119482/CWE78_OS_Command_Injection__char_file_popen_04.c
CWE78_OS_Command_Injection__char_file_popen_04_bad
void CWE78_OS_Command_Injection__char_file_popen_04_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; lStack_18 = func_0x00400b70(puStack_10); if ((1 < 100U - lStack_18) && (lStack_20 = func_0x00400c30(&UNK_0040140e,&UNK_0040140c), lStack_20 != 0)) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_0040141c); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } lStack_28 = func_0x00400c20(puStack_10,&UNK_0040142b); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,507
void CWE78_OS_Command_Injection__char_file_popen_04_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119482/CWE78_OS_Command_Injection__char_file_popen_04.c
CWE78_OS_Command_Injection__char_file_popen_04_good
void CWE78_OS_Command_Injection__char_file_popen_04_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,508
void CWE78_OS_Command_Injection__char_file_popen_05_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(staticTrue) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119483/CWE78_OS_Command_Injection__char_file_popen_05.c
CWE78_OS_Command_Injection__char_file_popen_05_bad
void CWE78_OS_Command_Injection__char_file_popen_05_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; if (staticTrue != 0) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,509
void CWE78_OS_Command_Injection__char_file_popen_05_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119483/CWE78_OS_Command_Injection__char_file_popen_05.c
CWE78_OS_Command_Injection__char_file_popen_05_good
void CWE78_OS_Command_Injection__char_file_popen_05_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,510
void CWE78_OS_Command_Injection__char_file_popen_06_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(STATIC_CONST_FIVE==5) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119484/CWE78_OS_Command_Injection__char_file_popen_06.c
CWE78_OS_Command_Injection__char_file_popen_06_bad
void CWE78_OS_Command_Injection__char_file_popen_06_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; lStack_18 = func_0x00400b70(puStack_10); if ((1 < 100U - lStack_18) && (lStack_20 = func_0x00400c30(&UNK_0040140a,&UNK_00401408), lStack_20 != 0)) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401418); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401427); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,511
void CWE78_OS_Command_Injection__char_file_popen_06_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119484/CWE78_OS_Command_Injection__char_file_popen_06.c
CWE78_OS_Command_Injection__char_file_popen_06_good
void CWE78_OS_Command_Injection__char_file_popen_06_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,512
void CWE78_OS_Command_Injection__char_file_popen_07_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(staticFive==5) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119485/CWE78_OS_Command_Injection__char_file_popen_07.c
CWE78_OS_Command_Injection__char_file_popen_07_bad
void CWE78_OS_Command_Injection__char_file_popen_07_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; if (staticFive == 5) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,513
void CWE78_OS_Command_Injection__char_file_popen_07_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119485/CWE78_OS_Command_Injection__char_file_popen_07.c
CWE78_OS_Command_Injection__char_file_popen_07_good
void CWE78_OS_Command_Injection__char_file_popen_07_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,514
void CWE78_OS_Command_Injection__char_file_popen_08_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(staticReturnsTrue()) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119486/CWE78_OS_Command_Injection__char_file_popen_08.c
CWE78_OS_Command_Injection__char_file_popen_08_bad
void CWE78_OS_Command_Injection__char_file_popen_08_bad(void) { int iVar1; long lVar2; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401426,&UNK_00401424); if (lStack_20 != 0) { lVar2 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar2 == 0) { printLine(&UNK_00401434); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401443); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,515
void CWE78_OS_Command_Injection__char_file_popen_08_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119486/CWE78_OS_Command_Injection__char_file_popen_08.c
CWE78_OS_Command_Injection__char_file_popen_08_good
void CWE78_OS_Command_Injection__char_file_popen_08_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,516
void CWE78_OS_Command_Injection__char_file_popen_09_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(GLOBAL_CONST_TRUE) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119487/CWE78_OS_Command_Injection__char_file_popen_09.c
CWE78_OS_Command_Injection__char_file_popen_09_bad
void CWE78_OS_Command_Injection__char_file_popen_09_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; if (GLOBAL_CONST_TRUE != 0) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,517
void CWE78_OS_Command_Injection__char_file_popen_09_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119487/CWE78_OS_Command_Injection__char_file_popen_09.c
CWE78_OS_Command_Injection__char_file_popen_09_good
void CWE78_OS_Command_Injection__char_file_popen_09_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,518
void CWE78_OS_Command_Injection__char_file_popen_10_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(globalTrue) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119488/CWE78_OS_Command_Injection__char_file_popen_10.c
CWE78_OS_Command_Injection__char_file_popen_10_bad
void CWE78_OS_Command_Injection__char_file_popen_10_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; if (globalTrue != 0) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,519
void CWE78_OS_Command_Injection__char_file_popen_10_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119488/CWE78_OS_Command_Injection__char_file_popen_10.c
CWE78_OS_Command_Injection__char_file_popen_10_good
void CWE78_OS_Command_Injection__char_file_popen_10_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,520
void CWE78_OS_Command_Injection__char_file_popen_11_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(globalReturnsTrue()) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119489/CWE78_OS_Command_Injection__char_file_popen_11.c
CWE78_OS_Command_Injection__char_file_popen_11_bad
void CWE78_OS_Command_Injection__char_file_popen_11_bad(void) { int iVar1; long lVar2; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar2 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar2 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,521
void CWE78_OS_Command_Injection__char_file_popen_11_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119489/CWE78_OS_Command_Injection__char_file_popen_11.c
CWE78_OS_Command_Injection__char_file_popen_11_good
void CWE78_OS_Command_Injection__char_file_popen_11_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,522
void CWE78_OS_Command_Injection__char_file_popen_12_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(globalReturnsTrueOrFalse()) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } else { /* FIX: Append a fixed string to data (not user / external input) */ strcat(data, "*.*"); } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* FIX: Append a fixed string to data (not user / external input) */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119490/CWE78_OS_Command_Injection__char_file_popen_12.c
CWE78_OS_Command_Injection__char_file_popen_12_bad
void CWE78_OS_Command_Injection__char_file_popen_12_bad(void) { char cVar1; int iVar2; long lVar3; ulong uVar4; undefined8 *puVar5; byte bVar6; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; bVar6 = 0; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; iVar2 = globalReturnsTrueOrFalse(); if (iVar2 == 0) { uVar4 = 0xffffffffffffffff; puVar5 = puStack_10; do { if (uVar4 == 0) break; uVar4 = uVar4 - 1; cVar1 = *(char *)puVar5; puVar5 = (undefined8 *)((long)puVar5 + (ulong)bVar6 * -2 + 1); } while (cVar1 != '\0'); *(undefined4 *)((long)puStack_10 + (~uVar4 - 1)) = 0x2a2e2a; } else { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401446,&UNK_00401444); if (lStack_20 != 0) { lVar3 = func_0x00400bc0((char *)((long)puStack_10 + lStack_18),100 - (int)lStack_18, lStack_20); if (lVar3 == 0) { printLine(&UNK_00401454); *(char *)(lStack_18 + (long)puStack_10) = '\0'; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401463); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,523
void CWE78_OS_Command_Injection__char_file_popen_12_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119490/CWE78_OS_Command_Injection__char_file_popen_12.c
CWE78_OS_Command_Injection__char_file_popen_12_good
void CWE78_OS_Command_Injection__char_file_popen_12_good(void) { goodG2B(); return; }
['gcc']
13,524
void CWE78_OS_Command_Injection__char_file_popen_13_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(GLOBAL_CONST_FIVE==5) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119491/CWE78_OS_Command_Injection__char_file_popen_13.c
CWE78_OS_Command_Injection__char_file_popen_13_bad
void CWE78_OS_Command_Injection__char_file_popen_13_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; if (GLOBAL_CONST_FIVE == 5) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,525
void CWE78_OS_Command_Injection__char_file_popen_13_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119491/CWE78_OS_Command_Injection__char_file_popen_13.c
CWE78_OS_Command_Injection__char_file_popen_13_good
void CWE78_OS_Command_Injection__char_file_popen_13_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,526
void CWE78_OS_Command_Injection__char_file_popen_14_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; if(globalFive==5) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119492/CWE78_OS_Command_Injection__char_file_popen_14.c
CWE78_OS_Command_Injection__char_file_popen_14_bad
void CWE78_OS_Command_Injection__char_file_popen_14_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; if (globalFive == 5) { lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401423); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,527
void CWE78_OS_Command_Injection__char_file_popen_14_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119492/CWE78_OS_Command_Injection__char_file_popen_14.c
CWE78_OS_Command_Injection__char_file_popen_14_good
void CWE78_OS_Command_Injection__char_file_popen_14_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,528
void CWE78_OS_Command_Injection__char_file_popen_15_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; switch(6) { case 6: { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119493/CWE78_OS_Command_Injection__char_file_popen_15.c
CWE78_OS_Command_Injection__char_file_popen_15_bad
void CWE78_OS_Command_Injection__char_file_popen_15_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_004013f6,&UNK_004013f4); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401404); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401413); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,529
void CWE78_OS_Command_Injection__char_file_popen_15_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119493/CWE78_OS_Command_Injection__char_file_popen_15.c
CWE78_OS_Command_Injection__char_file_popen_15_good
void CWE78_OS_Command_Injection__char_file_popen_15_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,530
void CWE78_OS_Command_Injection__char_file_popen_16_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; while(1) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } break; } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119494/CWE78_OS_Command_Injection__char_file_popen_16.c
CWE78_OS_Command_Injection__char_file_popen_16_bad
void CWE78_OS_Command_Injection__char_file_popen_16_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_004013f6,&UNK_004013f4); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401404); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401413); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,531
void CWE78_OS_Command_Injection__char_file_popen_16_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119494/CWE78_OS_Command_Injection__char_file_popen_16.c
CWE78_OS_Command_Injection__char_file_popen_16_good
void CWE78_OS_Command_Injection__char_file_popen_16_good(void) { goodG2B(); return; }
['gcc']
13,532
void CWE78_OS_Command_Injection__char_file_popen_17_bad() { int i; char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; for(i = 0; i < 1; i++) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119495/CWE78_OS_Command_Injection__char_file_popen_17.c
CWE78_OS_Command_Injection__char_file_popen_17_bad
void CWE78_OS_Command_Injection__char_file_popen_17_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_30; long lStack_28; long lStack_20; undefined8 *puStack_18; int iStack_c; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_18 = &uStack_98; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { lStack_28 = func_0x00400b70(puStack_18); if (1 < 100U - lStack_28) { lStack_30 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lStack_30 != 0) { lVar1 = func_0x00400bc0((long)puStack_18 + lStack_28,100 - (int)lStack_28,lStack_30); if (lVar1 == 0) { printLine(&UNK_00401424); *(undefined *)(lStack_28 + (long)puStack_18) = 0; } func_0x00400b60(lStack_30); } } } lStack_20 = func_0x00400c20(puStack_18,&UNK_00401433); if (lStack_20 != 0) { func_0x00400b90(lStack_20); } return; }
['gcc']
13,533
void CWE78_OS_Command_Injection__char_file_popen_17_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119495/CWE78_OS_Command_Injection__char_file_popen_17.c
CWE78_OS_Command_Injection__char_file_popen_17_good
void CWE78_OS_Command_Injection__char_file_popen_17_good(void) { goodG2B(); return; }
['gcc']
13,534
void CWE78_OS_Command_Injection__char_file_popen_18_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; goto source; source: { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119496/CWE78_OS_Command_Injection__char_file_popen_18.c
CWE78_OS_Command_Injection__char_file_popen_18_bad
void CWE78_OS_Command_Injection__char_file_popen_18_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_10 = &uStack_98; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_004013f6,&UNK_004013f4); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401404); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } lStack_28 = func_0x00400c20(puStack_10,&UNK_00401413); if (lStack_28 != 0) { func_0x00400b90(lStack_28); } return; }
['gcc']
13,535
void CWE78_OS_Command_Injection__char_file_popen_18_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119496/CWE78_OS_Command_Injection__char_file_popen_18.c
CWE78_OS_Command_Injection__char_file_popen_18_good
void CWE78_OS_Command_Injection__char_file_popen_18_good(void) { goodG2B(); return; }
['gcc']
13,536
void CWE78_OS_Command_Injection__char_file_popen_21_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; badStatic = 1; /* true */ data = badSource(data); { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* true */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119497/CWE78_OS_Command_Injection__char_file_popen_21.c
CWE78_OS_Command_Injection__char_file_popen_21_bad
void CWE78_OS_Command_Injection__char_file_popen_21_bad(void) { undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; badStatic = 1; puStack_10 = (undefined8 *)badSource(puStack_10); lStack_18 = func_0x00400c20(puStack_10,&UNK_00401443); if (lStack_18 != 0) { func_0x00400b90(lStack_18); } return; }
['gcc']
13,537
void CWE78_OS_Command_Injection__char_file_popen_21_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119497/CWE78_OS_Command_Injection__char_file_popen_21.c
CWE78_OS_Command_Injection__char_file_popen_21_good
void CWE78_OS_Command_Injection__char_file_popen_21_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,538
void CWE78_OS_Command_Injection__char_file_popen_22_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; CWE78_OS_Command_Injection__char_file_popen_22_badGlobal = 1; /* true */ data = CWE78_OS_Command_Injection__char_file_popen_22_badSource(data); { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* true */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119498/CWE78_OS_Command_Injection__char_file_popen_22a.c
CWE78_OS_Command_Injection__char_file_popen_22_bad
void CWE78_OS_Command_Injection__char_file_popen_22_bad(void) { undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; CWE78_OS_Command_Injection__char_file_popen_22_badGlobal = 1; puStack_10 = (undefined8 *)CWE78_OS_Command_Injection__char_file_popen_22_badSource(puStack_10); lStack_18 = func_0x00400c20(puStack_10,&UNK_00401424); if (lStack_18 != 0) { func_0x00400b90(lStack_18); } return; }
['gcc']
13,539
void CWE78_OS_Command_Injection__char_file_popen_22_good() { goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119498/CWE78_OS_Command_Injection__char_file_popen_22a.c
CWE78_OS_Command_Injection__char_file_popen_22_good
void CWE78_OS_Command_Injection__char_file_popen_22_good(void) { goodG2B1(); goodG2B2(); return; }
['gcc']
13,540
char * CWE78_OS_Command_Injection__char_file_popen_22_badSource(char * data) { if(CWE78_OS_Command_Injection__char_file_popen_22_badGlobal) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } } return data; }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119498/CWE78_OS_Command_Injection__char_file_popen_22b.c
CWE78_OS_Command_Injection__char_file_popen_22_badSource
long CWE78_OS_Command_Injection__char_file_popen_22_badSource(long param_1) { long lVar1; long lVar2; long lVar3; if (CWE78_OS_Command_Injection__char_file_popen_22_badGlobal != 0) { lVar1 = func_0x00400b70(param_1); if (1 < 100U - lVar1) { lVar2 = func_0x00400c30(&UNK_00401426,&UNK_00401424); if (lVar2 != 0) { lVar3 = func_0x00400bc0(param_1 + lVar1,100 - (int)lVar1,lVar2); if (lVar3 == 0) { printLine(&UNK_00401434); *(undefined *)(lVar1 + param_1) = 0; } func_0x00400b60(lVar2); } } } return param_1; }
['gcc']
13,541
char * CWE78_OS_Command_Injection__char_file_popen_22_goodG2B1Source(char * data) { if(CWE78_OS_Command_Injection__char_file_popen_22_goodG2B1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Append a fixed string to data (not user / external input) */ strcat(data, "*.*"); } return data; }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Append a fixed string to data (not user / external input) */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119498/CWE78_OS_Command_Injection__char_file_popen_22b.c
CWE78_OS_Command_Injection__char_file_popen_22_goodG2B1Source
char * CWE78_OS_Command_Injection__char_file_popen_22_goodG2B1Source(char *param_1) { char cVar1; ulong uVar2; char *pcVar3; if (CWE78_OS_Command_Injection__char_file_popen_22_goodG2B1Global == 0) { uVar2 = 0xffffffffffffffff; pcVar3 = param_1; do { if (uVar2 == 0) break; uVar2 = uVar2 - 1; cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); *(undefined4 *)(param_1 + (~uVar2 - 1)) = 0x2a2e2a; } else { printLine(&UNK_00401394); } return param_1; }
['gcc']
13,542
char * CWE78_OS_Command_Injection__char_file_popen_22_goodG2B2Source(char * data) { if(CWE78_OS_Command_Injection__char_file_popen_22_goodG2B2Global) { /* FIX: Append a fixed string to data (not user / external input) */ strcat(data, "*.*"); } return data; }
['/* FIX: Append a fixed string to data (not user / external input) */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119498/CWE78_OS_Command_Injection__char_file_popen_22b.c
CWE78_OS_Command_Injection__char_file_popen_22_goodG2B2Source
char * CWE78_OS_Command_Injection__char_file_popen_22_goodG2B2Source(char *param_1) { char cVar1; ulong uVar2; char *pcVar3; if (CWE78_OS_Command_Injection__char_file_popen_22_goodG2B2Global != 0) { uVar2 = 0xffffffffffffffff; pcVar3 = param_1; do { if (uVar2 == 0) break; uVar2 = uVar2 - 1; cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); *(undefined4 *)(param_1 + (~uVar2 - 1)) = 0x2a2e2a; } return param_1; }
['gcc']
13,543
void CWE78_OS_Command_Injection__char_file_popen_31_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } { char * dataCopy = data; char * data = dataCopy; { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119499/CWE78_OS_Command_Injection__char_file_popen_31.c
CWE78_OS_Command_Injection__char_file_popen_31_bad
void CWE78_OS_Command_Injection__char_file_popen_31_bad(void) { long lVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; long lStack_38; undefined8 *puStack_30; undefined8 *puStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_a8 = 0x2068732f6e69622f; uStack_a0 = 0x20616c2d20736c; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_10 = &uStack_a8; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401424); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } puStack_28 = puStack_10; puStack_30 = puStack_10; lStack_38 = func_0x00400c20(puStack_10,&UNK_00401433); if (lStack_38 != 0) { func_0x00400b90(lStack_38); } return; }
['gcc']
13,544
void CWE78_OS_Command_Injection__char_file_popen_31_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119499/CWE78_OS_Command_Injection__char_file_popen_31.c
CWE78_OS_Command_Injection__char_file_popen_31_good
void CWE78_OS_Command_Injection__char_file_popen_31_good(void) { goodG2B(); return; }
['gcc']
13,545
void CWE78_OS_Command_Injection__char_file_popen_32_bad() { char * data; char * *dataPtr1 = &data; char * *dataPtr2 = &data; char data_buf[100] = FULL_COMMAND; data = data_buf; { char * data = *dataPtr1; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } *dataPtr1 = data; } { char * data = *dataPtr2; { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119500/CWE78_OS_Command_Injection__char_file_popen_32.c
CWE78_OS_Command_Injection__char_file_popen_32_bad
/* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE78_OS_Command_Injection__char_file_popen_32_bad(void) { long lVar1; undefined8 uStack_b8; undefined8 uStack_b0; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined4 uStack_58; undefined8 *puStack_48; long lStack_40; undefined8 *puStack_38; long lStack_30; long lStack_28; undefined8 *puStack_20; undefined8 **ppuStack_18; undefined8 **ppuStack_10; ppuStack_10 = &puStack_48; ppuStack_18 = &puStack_48; uStack_b8 = 0x2068732f6e69622f; uStack_b0 = 0x20616c2d20736c; uStack_a8 = 0; uStack_a0 = 0; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; puStack_48 = &uStack_b8; puStack_20 = puStack_48; lStack_28 = func_0x00400b70(puStack_48); if (1 < 100U - lStack_28) { lStack_30 = func_0x00400c30(&UNK_00401436,&UNK_00401434); if (lStack_30 != 0) { lVar1 = func_0x00400bc0((long)puStack_20 + lStack_28,100 - (int)lStack_28,lStack_30); if (lVar1 == 0) { printLine(&UNK_00401444); *(undefined *)(lStack_28 + (long)puStack_20) = 0; } func_0x00400b60(lStack_30); } } *ppuStack_10 = puStack_20; puStack_38 = *ppuStack_18; lStack_40 = func_0x00400c20(puStack_38,&UNK_00401453); if (lStack_40 != 0) { func_0x00400b90(lStack_40); } return; }
['gcc']
13,546
void CWE78_OS_Command_Injection__char_file_popen_32_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119500/CWE78_OS_Command_Injection__char_file_popen_32.c
CWE78_OS_Command_Injection__char_file_popen_32_good
void CWE78_OS_Command_Injection__char_file_popen_32_good(void) { goodG2B(); return; }
['gcc']
13,547
void CWE78_OS_Command_Injection__char_file_popen_34_bad() { char * data; CWE78_OS_Command_Injection__char_file_popen_34_unionType myUnion; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } myUnion.unionFirst = data; { char * data = myUnion.unionSecond; { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } } }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119502/CWE78_OS_Command_Injection__char_file_popen_34.c
CWE78_OS_Command_Injection__char_file_popen_34_bad
void CWE78_OS_Command_Injection__char_file_popen_34_bad(void) { long lVar1; undefined8 uStack_a8; undefined8 uStack_a0; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined4 uStack_48; undefined8 *puStack_38; long lStack_30; undefined8 *puStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_a8 = 0x2068732f6e69622f; uStack_a0 = 0x20616c2d20736c; uStack_98 = 0; uStack_90 = 0; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; puStack_10 = &uStack_a8; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401424); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } puStack_38 = puStack_10; puStack_28 = puStack_10; lStack_30 = func_0x00400c20(puStack_10,&UNK_00401433); if (lStack_30 != 0) { func_0x00400b90(lStack_30); } return; }
['gcc']
13,548
void CWE78_OS_Command_Injection__char_file_popen_34_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119502/CWE78_OS_Command_Injection__char_file_popen_34.c
CWE78_OS_Command_Injection__char_file_popen_34_good
void CWE78_OS_Command_Injection__char_file_popen_34_good(void) { goodG2B(); return; }
['gcc']
13,549
void CWE78_OS_Command_Injection__char_file_popen_41_badSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119503/CWE78_OS_Command_Injection__char_file_popen_41.c
CWE78_OS_Command_Injection__char_file_popen_41_badSink
void CWE78_OS_Command_Injection__char_file_popen_41_badSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400c20(param_1,&UNK_00401404); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,550
void CWE78_OS_Command_Injection__char_file_popen_41_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_41_badSink(data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119503/CWE78_OS_Command_Injection__char_file_popen_41.c
CWE78_OS_Command_Injection__char_file_popen_41_bad
void CWE78_OS_Command_Injection__char_file_popen_41_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401409,&UNK_00401407); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401417); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } CWE78_OS_Command_Injection__char_file_popen_41_badSink(puStack_10); return; }
['gcc']
13,551
void CWE78_OS_Command_Injection__char_file_popen_41_goodG2BSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119503/CWE78_OS_Command_Injection__char_file_popen_41.c
CWE78_OS_Command_Injection__char_file_popen_41_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_41_goodG2BSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400ad0(param_1,&UNK_00401254); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,552
void CWE78_OS_Command_Injection__char_file_popen_41_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119503/CWE78_OS_Command_Injection__char_file_popen_41.c
CWE78_OS_Command_Injection__char_file_popen_41_good
void CWE78_OS_Command_Injection__char_file_popen_41_good(void) { goodG2B(); return; }
['gcc']
13,553
void CWE78_OS_Command_Injection__char_file_popen_42_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; data = badSource(data); { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119504/CWE78_OS_Command_Injection__char_file_popen_42.c
CWE78_OS_Command_Injection__char_file_popen_42_bad
void CWE78_OS_Command_Injection__char_file_popen_42_bad(void) { undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; puStack_10 = (undefined8 *)badSource(puStack_10); lStack_18 = func_0x00400c20(puStack_10,&UNK_00401433); if (lStack_18 != 0) { func_0x00400b90(lStack_18); } return; }
['gcc']
13,554
void CWE78_OS_Command_Injection__char_file_popen_42_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119504/CWE78_OS_Command_Injection__char_file_popen_42.c
CWE78_OS_Command_Injection__char_file_popen_42_good
void CWE78_OS_Command_Injection__char_file_popen_42_good(void) { goodG2B(); return; }
['gcc']
13,555
void CWE78_OS_Command_Injection__char_file_popen_44_bad() { char * data; /* define a function pointer */ void (*funcPtr) (char *) = badSink; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* use the function pointer */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119506/CWE78_OS_Command_Injection__char_file_popen_44.c
CWE78_OS_Command_Injection__char_file_popen_44_bad
void CWE78_OS_Command_Injection__char_file_popen_44_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; undefined8 *puStack_18; code *pcStack_10; pcStack_10 = badSink; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_18 = &uStack_98; lStack_20 = func_0x00400b70(puStack_18); if (1 < 100U - lStack_20) { lStack_28 = func_0x00400c30(&UNK_00401419,&UNK_00401417); if (lStack_28 != 0) { lVar1 = func_0x00400bc0((long)puStack_18 + lStack_20,100 - (int)lStack_20,lStack_28); if (lVar1 == 0) { printLine(&UNK_00401427); *(undefined *)(lStack_20 + (long)puStack_18) = 0; } func_0x00400b60(lStack_28); } } (*pcStack_10)(puStack_18); return; }
['gcc']
13,556
void CWE78_OS_Command_Injection__char_file_popen_44_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119506/CWE78_OS_Command_Injection__char_file_popen_44.c
CWE78_OS_Command_Injection__char_file_popen_44_good
void CWE78_OS_Command_Injection__char_file_popen_44_good(void) { goodG2B(); return; }
['gcc']
13,557
void CWE78_OS_Command_Injection__char_file_popen_45_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_45_badData = data; badSink(); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119507/CWE78_OS_Command_Injection__char_file_popen_45.c
CWE78_OS_Command_Injection__char_file_popen_45_bad
void CWE78_OS_Command_Injection__char_file_popen_45_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401419,&UNK_00401417); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401427); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } CWE78_OS_Command_Injection__char_file_popen_45_badData = puStack_10; badSink(); return; }
['gcc']
13,558
void CWE78_OS_Command_Injection__char_file_popen_45_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119507/CWE78_OS_Command_Injection__char_file_popen_45.c
CWE78_OS_Command_Injection__char_file_popen_45_good
void CWE78_OS_Command_Injection__char_file_popen_45_good(void) { goodG2B(); return; }
['gcc']
13,559
void CWE78_OS_Command_Injection__char_file_popen_51_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_51b_badSink(data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119508/CWE78_OS_Command_Injection__char_file_popen_51a.c
CWE78_OS_Command_Injection__char_file_popen_51_bad
void CWE78_OS_Command_Injection__char_file_popen_51_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401406,&UNK_00401404); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401414); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } CWE78_OS_Command_Injection__char_file_popen_51b_badSink(puStack_10); return; }
['gcc']
13,560
void CWE78_OS_Command_Injection__char_file_popen_51_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119508/CWE78_OS_Command_Injection__char_file_popen_51a.c
CWE78_OS_Command_Injection__char_file_popen_51_good
void CWE78_OS_Command_Injection__char_file_popen_51_good(void) { goodG2B(); return; }
['gcc']
13,561
void CWE78_OS_Command_Injection__char_file_popen_51b_badSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119508/CWE78_OS_Command_Injection__char_file_popen_51b.c
CWE78_OS_Command_Injection__char_file_popen_51b_badSink
void CWE78_OS_Command_Injection__char_file_popen_51b_badSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400c20(param_1,&UNK_00401404); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,562
void CWE78_OS_Command_Injection__char_file_popen_51b_goodG2BSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119508/CWE78_OS_Command_Injection__char_file_popen_51b.c
CWE78_OS_Command_Injection__char_file_popen_51b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_51b_goodG2BSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400ad0(param_1,&UNK_00401254); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,563
void CWE78_OS_Command_Injection__char_file_popen_52_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_52b_badSink(data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119509/CWE78_OS_Command_Injection__char_file_popen_52a.c
CWE78_OS_Command_Injection__char_file_popen_52_bad
void CWE78_OS_Command_Injection__char_file_popen_52_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401426,&UNK_00401424); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401434); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } CWE78_OS_Command_Injection__char_file_popen_52b_badSink(puStack_10); return; }
['gcc']
13,564
void CWE78_OS_Command_Injection__char_file_popen_52_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119509/CWE78_OS_Command_Injection__char_file_popen_52a.c
CWE78_OS_Command_Injection__char_file_popen_52_good
void CWE78_OS_Command_Injection__char_file_popen_52_good(void) { goodG2B(); return; }
['gcc']
13,565
void CWE78_OS_Command_Injection__char_file_popen_52b_badSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_52c_badSink(data); }
[]
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119509/CWE78_OS_Command_Injection__char_file_popen_52b.c
CWE78_OS_Command_Injection__char_file_popen_52b_badSink
void CWE78_OS_Command_Injection__char_file_popen_52b_badSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_52c_badSink(param_1); return; }
['gcc']
13,566
void CWE78_OS_Command_Injection__char_file_popen_52b_goodG2BSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119509/CWE78_OS_Command_Injection__char_file_popen_52b.c
CWE78_OS_Command_Injection__char_file_popen_52b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_52b_goodG2BSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_52c_goodG2BSink(param_1); return; }
['gcc']
13,567
void CWE78_OS_Command_Injection__char_file_popen_52c_badSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119509/CWE78_OS_Command_Injection__char_file_popen_52c.c
CWE78_OS_Command_Injection__char_file_popen_52c_badSink
void CWE78_OS_Command_Injection__char_file_popen_52c_badSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400c20(param_1,&UNK_00401424); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,568
void CWE78_OS_Command_Injection__char_file_popen_52c_goodG2BSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119509/CWE78_OS_Command_Injection__char_file_popen_52c.c
CWE78_OS_Command_Injection__char_file_popen_52c_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_52c_goodG2BSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400ad0(param_1,&UNK_00401274); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,569
void CWE78_OS_Command_Injection__char_file_popen_53_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_53b_badSink(data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53a.c
CWE78_OS_Command_Injection__char_file_popen_53_bad
void CWE78_OS_Command_Injection__char_file_popen_53_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401436,&UNK_00401434); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401444); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } CWE78_OS_Command_Injection__char_file_popen_53b_badSink(puStack_10); return; }
['gcc']
13,570
void CWE78_OS_Command_Injection__char_file_popen_53_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53a.c
CWE78_OS_Command_Injection__char_file_popen_53_good
void CWE78_OS_Command_Injection__char_file_popen_53_good(void) { goodG2B(); return; }
['gcc']
13,571
void CWE78_OS_Command_Injection__char_file_popen_53b_badSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_53c_badSink(data); }
[]
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53b.c
CWE78_OS_Command_Injection__char_file_popen_53b_badSink
void CWE78_OS_Command_Injection__char_file_popen_53b_badSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_53c_badSink(param_1); return; }
['gcc']
13,572
void CWE78_OS_Command_Injection__char_file_popen_53b_goodG2BSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53b.c
CWE78_OS_Command_Injection__char_file_popen_53b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_53b_goodG2BSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_53c_goodG2BSink(param_1); return; }
['gcc']
13,573
void CWE78_OS_Command_Injection__char_file_popen_53c_badSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_53d_badSink(data); }
[]
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53c.c
CWE78_OS_Command_Injection__char_file_popen_53c_badSink
void CWE78_OS_Command_Injection__char_file_popen_53c_badSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_53d_badSink(param_1); return; }
['gcc']
13,574
void CWE78_OS_Command_Injection__char_file_popen_53c_goodG2BSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53c.c
CWE78_OS_Command_Injection__char_file_popen_53c_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_53c_goodG2BSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_53d_goodG2BSink(param_1); return; }
['gcc']
13,575
void CWE78_OS_Command_Injection__char_file_popen_53d_badSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53d.c
CWE78_OS_Command_Injection__char_file_popen_53d_badSink
void CWE78_OS_Command_Injection__char_file_popen_53d_badSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400c20(param_1,&UNK_00401434); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,576
void CWE78_OS_Command_Injection__char_file_popen_53d_goodG2BSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119510/CWE78_OS_Command_Injection__char_file_popen_53d.c
CWE78_OS_Command_Injection__char_file_popen_53d_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_53d_goodG2BSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400ad0(param_1,&UNK_00401294); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,577
void CWE78_OS_Command_Injection__char_file_popen_54_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_54b_badSink(data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54a.c
CWE78_OS_Command_Injection__char_file_popen_54_bad
void CWE78_OS_Command_Injection__char_file_popen_54_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_20; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; lStack_18 = func_0x00400b70(puStack_10); if (1 < 100U - lStack_18) { lStack_20 = func_0x00400c30(&UNK_00401456,&UNK_00401454); if (lStack_20 != 0) { lVar1 = func_0x00400bc0((long)puStack_10 + lStack_18,100 - (int)lStack_18,lStack_20); if (lVar1 == 0) { printLine(&UNK_00401464); *(undefined *)(lStack_18 + (long)puStack_10) = 0; } func_0x00400b60(lStack_20); } } CWE78_OS_Command_Injection__char_file_popen_54b_badSink(puStack_10); return; }
['gcc']
13,578
void CWE78_OS_Command_Injection__char_file_popen_54_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54a.c
CWE78_OS_Command_Injection__char_file_popen_54_good
void CWE78_OS_Command_Injection__char_file_popen_54_good(void) { goodG2B(); return; }
['gcc']
13,579
void CWE78_OS_Command_Injection__char_file_popen_54b_badSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_54c_badSink(data); }
[]
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54b.c
CWE78_OS_Command_Injection__char_file_popen_54b_badSink
void CWE78_OS_Command_Injection__char_file_popen_54b_badSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_54c_badSink(param_1); return; }
['gcc']
13,580
void CWE78_OS_Command_Injection__char_file_popen_54b_goodG2BSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_54c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54b.c
CWE78_OS_Command_Injection__char_file_popen_54b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_54b_goodG2BSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_54c_goodG2BSink(param_1); return; }
['gcc']
13,581
void CWE78_OS_Command_Injection__char_file_popen_54c_badSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_54d_badSink(data); }
[]
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54c.c
CWE78_OS_Command_Injection__char_file_popen_54c_badSink
void CWE78_OS_Command_Injection__char_file_popen_54c_badSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_54d_badSink(param_1); return; }
['gcc']
13,582
void CWE78_OS_Command_Injection__char_file_popen_54c_goodG2BSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_54d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54c.c
CWE78_OS_Command_Injection__char_file_popen_54c_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_54c_goodG2BSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_54d_goodG2BSink(param_1); return; }
['gcc']
13,583
void CWE78_OS_Command_Injection__char_file_popen_54d_badSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_54e_badSink(data); }
[]
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54d.c
CWE78_OS_Command_Injection__char_file_popen_54d_badSink
void CWE78_OS_Command_Injection__char_file_popen_54d_badSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_54e_badSink(param_1); return; }
['gcc']
13,584
void CWE78_OS_Command_Injection__char_file_popen_54d_goodG2BSink(char * data) { CWE78_OS_Command_Injection__char_file_popen_54e_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54d.c
CWE78_OS_Command_Injection__char_file_popen_54d_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_54d_goodG2BSink(undefined8 param_1) { CWE78_OS_Command_Injection__char_file_popen_54e_goodG2BSink(param_1); return; }
['gcc']
13,585
void CWE78_OS_Command_Injection__char_file_popen_54e_badSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54e.c
CWE78_OS_Command_Injection__char_file_popen_54e_badSink
void CWE78_OS_Command_Injection__char_file_popen_54e_badSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400c20(param_1,&UNK_00401454); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,586
void CWE78_OS_Command_Injection__char_file_popen_54e_goodG2BSink(char * data) { { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119511/CWE78_OS_Command_Injection__char_file_popen_54e.c
CWE78_OS_Command_Injection__char_file_popen_54e_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_54e_goodG2BSink(undefined8 param_1) { long lVar1; lVar1 = func_0x00400ad0(param_1,&UNK_004012a4); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,587
void CWE78_OS_Command_Injection__char_file_popen_61_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; data = CWE78_OS_Command_Injection__char_file_popen_61b_badSource(data); { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119512/CWE78_OS_Command_Injection__char_file_popen_61a.c
CWE78_OS_Command_Injection__char_file_popen_61_bad
void CWE78_OS_Command_Injection__char_file_popen_61_bad(void) { undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; long lStack_18; undefined8 *puStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_10 = &uStack_88; puStack_10 = (undefined8 *)CWE78_OS_Command_Injection__char_file_popen_61b_badSource(puStack_10); lStack_18 = func_0x00400c20(puStack_10,&UNK_00401414); if (lStack_18 != 0) { func_0x00400b90(lStack_18); } return; }
['gcc']
13,588
void CWE78_OS_Command_Injection__char_file_popen_61_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119512/CWE78_OS_Command_Injection__char_file_popen_61a.c
CWE78_OS_Command_Injection__char_file_popen_61_good
void CWE78_OS_Command_Injection__char_file_popen_61_good(void) { goodG2B(); return; }
['gcc']
13,589
char * CWE78_OS_Command_Injection__char_file_popen_61b_badSource(char * data) { { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } return data; }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119512/CWE78_OS_Command_Injection__char_file_popen_61b.c
CWE78_OS_Command_Injection__char_file_popen_61b_badSource
long CWE78_OS_Command_Injection__char_file_popen_61b_badSource(long param_1) { long lVar1; long lVar2; long lVar3; lVar1 = func_0x00400b70(param_1); if (1 < 100U - lVar1) { lVar2 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lVar2 != 0) { lVar3 = func_0x00400bc0(param_1 + lVar1,100 - (int)lVar1,lVar2); if (lVar3 == 0) { printLine(&UNK_00401424); *(undefined *)(lVar1 + param_1) = 0; } func_0x00400b60(lVar2); } } return param_1; }
['gcc']
13,590
char * CWE78_OS_Command_Injection__char_file_popen_61b_goodG2BSource(char * data) { /* FIX: Append a fixed string to data (not user / external input) */ strcat(data, "*.*"); return data; }
['/* FIX: Append a fixed string to data (not user / external input) */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119512/CWE78_OS_Command_Injection__char_file_popen_61b.c
CWE78_OS_Command_Injection__char_file_popen_61b_goodG2BSource
char * CWE78_OS_Command_Injection__char_file_popen_61b_goodG2BSource(char *param_1) { char cVar1; ulong uVar2; char *pcVar3; uVar2 = 0xffffffffffffffff; pcVar3 = param_1; do { if (uVar2 == 0) break; uVar2 = uVar2 - 1; cVar1 = *pcVar3; pcVar3 = pcVar3 + 1; } while (cVar1 != '\0'); *(undefined4 *)(param_1 + (~uVar2 - 1)) = 0x2a2e2a; return param_1; }
['gcc']
13,591
void CWE78_OS_Command_Injection__char_file_popen_63_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_63b_badSink(&data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119514/CWE78_OS_Command_Injection__char_file_popen_63a.c
CWE78_OS_Command_Injection__char_file_popen_63_bad
void CWE78_OS_Command_Injection__char_file_popen_63_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; undefined8 *puStack_20; long lStack_18; long lStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_20 = &uStack_88; lStack_10 = func_0x00400b70(puStack_20); if (1 < 100U - lStack_10) { lStack_18 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lStack_18 != 0) { lVar1 = func_0x00400bc0((long)puStack_20 + lStack_10,100 - (int)lStack_10,lStack_18); if (lVar1 == 0) { printLine(&UNK_00401424); *(undefined *)(lStack_10 + (long)puStack_20) = 0; } func_0x00400b60(lStack_18); } } CWE78_OS_Command_Injection__char_file_popen_63b_badSink(&puStack_20); return; }
['gcc']
13,592
void CWE78_OS_Command_Injection__char_file_popen_63_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119514/CWE78_OS_Command_Injection__char_file_popen_63a.c
CWE78_OS_Command_Injection__char_file_popen_63_good
void CWE78_OS_Command_Injection__char_file_popen_63_good(void) { goodG2B(); return; }
['gcc']
13,593
void CWE78_OS_Command_Injection__char_file_popen_63b_badSink(char * * dataPtr) { char * data = *dataPtr; { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119514/CWE78_OS_Command_Injection__char_file_popen_63b.c
CWE78_OS_Command_Injection__char_file_popen_63b_badSink
void CWE78_OS_Command_Injection__char_file_popen_63b_badSink(undefined8 *param_1) { long lVar1; lVar1 = func_0x00400c20(*param_1,&UNK_00401414); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,594
void CWE78_OS_Command_Injection__char_file_popen_63b_goodG2BSink(char * * dataPtr) { char * data = *dataPtr; { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119514/CWE78_OS_Command_Injection__char_file_popen_63b.c
CWE78_OS_Command_Injection__char_file_popen_63b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_63b_goodG2BSink(undefined8 *param_1) { long lVar1; lVar1 = func_0x00400ad0(*param_1,&UNK_00401264); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,595
void CWE78_OS_Command_Injection__char_file_popen_64_bad() { char * data; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } CWE78_OS_Command_Injection__char_file_popen_64b_badSink(&data); }
['/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119515/CWE78_OS_Command_Injection__char_file_popen_64a.c
CWE78_OS_Command_Injection__char_file_popen_64_bad
void CWE78_OS_Command_Injection__char_file_popen_64_bad(void) { long lVar1; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined8 uStack_38; undefined8 uStack_30; undefined4 uStack_28; undefined8 *puStack_20; long lStack_18; long lStack_10; uStack_88 = 0x2068732f6e69622f; uStack_80 = 0x20616c2d20736c; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; uStack_30 = 0; uStack_28 = 0; puStack_20 = &uStack_88; lStack_10 = func_0x00400b70(puStack_20); if (1 < 100U - lStack_10) { lStack_18 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lStack_18 != 0) { lVar1 = func_0x00400bc0((long)puStack_20 + lStack_10,100 - (int)lStack_10,lStack_18); if (lVar1 == 0) { printLine(&UNK_00401424); *(undefined *)(lStack_10 + (long)puStack_20) = 0; } func_0x00400b60(lStack_18); } } CWE78_OS_Command_Injection__char_file_popen_64b_badSink(&puStack_20); return; }
['gcc']
13,596
void CWE78_OS_Command_Injection__char_file_popen_64_good() { goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119515/CWE78_OS_Command_Injection__char_file_popen_64a.c
CWE78_OS_Command_Injection__char_file_popen_64_good
void CWE78_OS_Command_Injection__char_file_popen_64_good(void) { goodG2B(); return; }
['gcc']
13,597
void CWE78_OS_Command_Injection__char_file_popen_64b_badSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ char * * dataPtr = (char * *)dataVoidPtr; /* dereference dataPtr into data */ char * data = (*dataPtr); { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119515/CWE78_OS_Command_Injection__char_file_popen_64b.c
CWE78_OS_Command_Injection__char_file_popen_64b_badSink
void CWE78_OS_Command_Injection__char_file_popen_64b_badSink(undefined8 *param_1) { long lVar1; lVar1 = func_0x00400c20(*param_1,&UNK_00401414); if (lVar1 != 0) { func_0x00400b90(lVar1); } return; }
['gcc']
13,598
void CWE78_OS_Command_Injection__char_file_popen_64b_goodG2BSink(void * dataVoidPtr) { /* cast void pointer to a pointer of the appropriate type */ char * * dataPtr = (char * *)dataVoidPtr; /* dereference dataPtr into data */ char * data = (*dataPtr); { FILE *pipe; /* POTENTIAL FLAW: Execute command in data possibly leading to command injection */ pipe = POPEN(data, "wb"); if (pipe != NULL) { PCLOSE(pipe); } } }
['/* cast void pointer to a pointer of the appropriate type */', '/* dereference dataPtr into data */', '/* POTENTIAL FLAW: Execute command in data possibly leading to command injection */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119515/CWE78_OS_Command_Injection__char_file_popen_64b.c
CWE78_OS_Command_Injection__char_file_popen_64b_goodG2BSink
void CWE78_OS_Command_Injection__char_file_popen_64b_goodG2BSink(undefined8 *param_1) { long lVar1; lVar1 = func_0x00400ad0(*param_1,&UNK_00401264); if (lVar1 != 0) { func_0x00400a50(lVar1); } return; }
['gcc']
13,599
void CWE78_OS_Command_Injection__char_file_popen_65_bad() { char * data; /* define a function pointer */ void (*funcPtr) (char *) = CWE78_OS_Command_Injection__char_file_popen_65b_badSink; char data_buf[100] = FULL_COMMAND; data = data_buf; { /* Read input from a file */ size_t dataLen = strlen(data); FILE * pFile; /* if there is room in data, attempt to read the input from a file */ if (100-dataLen > 1) { pFile = fopen(FILENAME, "r"); if (pFile != NULL) { /* POTENTIAL FLAW: Read data from a file */ if (fgets(data+dataLen, (int)(100-dataLen), pFile) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ data[dataLen] = '\0'; } fclose(pFile); } } } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Read input from a file */', '/* if there is room in data, attempt to read the input from a file */', '/* POTENTIAL FLAW: Read data from a file */', '/* Restore NUL terminator if fgets fails */', '/* use the function pointer */']
['CWE78']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/119516/CWE78_OS_Command_Injection__char_file_popen_65a.c
CWE78_OS_Command_Injection__char_file_popen_65_bad
void CWE78_OS_Command_Injection__char_file_popen_65_bad(void) { long lVar1; undefined8 uStack_98; undefined8 uStack_90; undefined8 uStack_88; undefined8 uStack_80; undefined8 uStack_78; undefined8 uStack_70; undefined8 uStack_68; undefined8 uStack_60; undefined8 uStack_58; undefined8 uStack_50; undefined8 uStack_48; undefined8 uStack_40; undefined4 uStack_38; long lStack_28; long lStack_20; undefined8 *puStack_18; code *pcStack_10; pcStack_10 = CWE78_OS_Command_Injection__char_file_popen_65b_badSink; uStack_98 = 0x2068732f6e69622f; uStack_90 = 0x20616c2d20736c; uStack_88 = 0; uStack_80 = 0; uStack_78 = 0; uStack_70 = 0; uStack_68 = 0; uStack_60 = 0; uStack_58 = 0; uStack_50 = 0; uStack_48 = 0; uStack_40 = 0; uStack_38 = 0; puStack_18 = &uStack_98; lStack_20 = func_0x00400b70(puStack_18); if (1 < 100U - lStack_20) { lStack_28 = func_0x00400c30(&UNK_00401416,&UNK_00401414); if (lStack_28 != 0) { lVar1 = func_0x00400bc0((long)puStack_18 + lStack_20,100 - (int)lStack_20,lStack_28); if (lVar1 == 0) { printLine(&UNK_00401424); *(undefined *)(lStack_20 + (long)puStack_18) = 0; } func_0x00400b60(lStack_28); } } (*pcStack_10)(puStack_18); return; }
['gcc']