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
52,700
void CWE367_TOC_TOU__stat_11_bad() { if(globalReturnsTrue()) { { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94666/CWE367_TOC_TOU__stat_11.c
CWE367_TOC_TOU__stat_11_bad
void CWE367_TOC_TOU__stat_11_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [156]; int iStack_c; uStack_120 = &UNK_00400dd7; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400e8f; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e9e; printLine(&UNK_004014f0); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400ec2; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ee7; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ef6; func_0x00400cc0(1); } uStack_120 = &UNK_00400f0f; iStack_c = func_0x00400cb0(&uStack_118,2); if (iStack_c == -1) { uStack_120 = &UNK_00400f22; func_0x00400cc0(1); } uStack_120 = &UNK_00400f36; lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f46; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00400f56; func_0x00400c10(iStack_c); } } return; }
['gcc']
52,701
void CWE367_TOC_TOU__stat_11_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94666/CWE367_TOC_TOU__stat_11.c
CWE367_TOC_TOU__stat_11_good
void CWE367_TOC_TOU__stat_11_good(void) { good1(); good2(); return; }
['gcc']
52,702
void CWE367_TOC_TOU__stat_12_bad() { if(globalReturnsTrueOrFalse()) { { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } } else { { char filename[100] = ""; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FIX: Open the file without checking the status information */ fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, GOOD_SINK_STRING, strlen(GOOD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */', '/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FIX: Open the file without checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94667/CWE367_TOC_TOU__stat_12.c
CWE367_TOC_TOU__stat_12_bad
void CWE367_TOC_TOU__stat_12_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; char cStack_a9; ulong 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; int iStack_10; int iStack_c; uStack_120 = &UNK_00400dd7; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 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; uStack_50 = 0; uStack_48 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400ff4; lVar2 = func_0x00400c40(&uStack_a8,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00401003; printLine(&UNK_00401630); uStack_a8 = uStack_a8 & 0xffffffffffffff00; } if ((char)uStack_a8 != '\0') { uStack_120 = &UNK_00401027; lVar2 = func_0x00400bf0(&uStack_a8); (&cStack_a9)[lVar2] = '\0'; } uStack_120 = &UNK_0040104c; iStack_c = func_0x00400cb0(&uStack_a8,2); if (iStack_c == -1) { uStack_120 = &UNK_0040105f; func_0x00400cc0(1); } uStack_120 = &UNK_00401073; lVar2 = func_0x00400bd0(iStack_c,&UNK_0040164b,0xc); if (lVar2 == -1) { uStack_120 = &UNK_00401083; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00401093; func_0x00400c10(iStack_c); } } else { uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_10 = 0xffffffff; uStack_120 = &UNK_00400e8f; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e9e; printLine(&UNK_00401630); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400ec2; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ee7; iVar1 = stat(&uStack_118,&uStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ef6; func_0x00400cc0(1); } uStack_120 = &UNK_00400f0f; iStack_10 = func_0x00400cb0(&uStack_118,2); if (iStack_10 == -1) { uStack_120 = &UNK_00400f22; func_0x00400cc0(1); } uStack_120 = &UNK_00400f36; lVar2 = func_0x00400bd0(iStack_10,&UNK_0040163f,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f46; func_0x00400cc0(1); } if (iStack_10 != -1) { uStack_120 = &UNK_00400f5a; func_0x00400c10(iStack_10); } } return; }
['gcc']
52,703
void CWE367_TOC_TOU__stat_12_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94667/CWE367_TOC_TOU__stat_12.c
CWE367_TOC_TOU__stat_12_good
void CWE367_TOC_TOU__stat_12_good(void) { good1(); return; }
['gcc']
52,704
void CWE367_TOC_TOU__stat_13_bad() { if(GLOBAL_CONST_FIVE==5) { { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94668/CWE367_TOC_TOU__stat_13.c
CWE367_TOC_TOU__stat_13_bad
void CWE367_TOC_TOU__stat_13_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [156]; int iStack_c; if (GLOBAL_CONST_FIVE == 5) { uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400e8c; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e9b; printLine(&UNK_004014f0); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400ebf; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ee4; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ef3; func_0x00400cc0(1); } uStack_120 = &UNK_00400f0c; iStack_c = func_0x00400cb0(&uStack_118,2); if (iStack_c == -1) { uStack_120 = &UNK_00400f1f; func_0x00400cc0(1); } uStack_120 = &UNK_00400f33; lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f43; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00400f53; func_0x00400c10(iStack_c); } } return; }
['gcc']
52,705
void CWE367_TOC_TOU__stat_13_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94668/CWE367_TOC_TOU__stat_13.c
CWE367_TOC_TOU__stat_13_good
void CWE367_TOC_TOU__stat_13_good(void) { good1(); good2(); return; }
['gcc']
52,706
void CWE367_TOC_TOU__stat_14_bad() { if(globalFive==5) { { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94669/CWE367_TOC_TOU__stat_14.c
CWE367_TOC_TOU__stat_14_bad
void CWE367_TOC_TOU__stat_14_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [156]; int iStack_c; if (globalFive == 5) { uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400e8c; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e9b; printLine(&UNK_004014f0); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400ebf; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ee4; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ef3; func_0x00400cc0(1); } uStack_120 = &UNK_00400f0c; iStack_c = func_0x00400cb0(&uStack_118,2); if (iStack_c == -1) { uStack_120 = &UNK_00400f1f; func_0x00400cc0(1); } uStack_120 = &UNK_00400f33; lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ff,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f43; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00400f53; func_0x00400c10(iStack_c); } } return; }
['gcc']
52,707
void CWE367_TOC_TOU__stat_14_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94669/CWE367_TOC_TOU__stat_14.c
CWE367_TOC_TOU__stat_14_good
void CWE367_TOC_TOU__stat_14_good(void) { good1(); good2(); return; }
['gcc']
52,708
void CWE367_TOC_TOU__stat_15_bad() { switch(6) { case 6: { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94670/CWE367_TOC_TOU__stat_15.c
CWE367_TOC_TOU__stat_15_bad
void CWE367_TOC_TOU__stat_15_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [156]; int iStack_c; uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400e7d; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e8c; printLine(&UNK_004014e0); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400eb0; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ed5; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ee4; func_0x00400cc0(1); } uStack_120 = &UNK_00400efd; iStack_c = func_0x00400cb0(&uStack_118,2); if (iStack_c == -1) { uStack_120 = &UNK_00400f10; func_0x00400cc0(1); } uStack_120 = &UNK_00400f24; lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ef,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f34; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00400f44; func_0x00400c10(iStack_c); } return; }
['gcc']
52,709
void CWE367_TOC_TOU__stat_15_good() { good1(); good2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94670/CWE367_TOC_TOU__stat_15.c
CWE367_TOC_TOU__stat_15_good
void CWE367_TOC_TOU__stat_15_good(void) { good1(); good2(); return; }
['gcc']
52,710
void CWE367_TOC_TOU__stat_16_bad() { while(1) { { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } break; } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94671/CWE367_TOC_TOU__stat_16.c
CWE367_TOC_TOU__stat_16_bad
void CWE367_TOC_TOU__stat_16_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [156]; int iStack_c; uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400e7d; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e8c; printLine(&UNK_004014e0); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400eb0; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ed5; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ee4; func_0x00400cc0(1); } uStack_120 = &UNK_00400efd; iStack_c = func_0x00400cb0(&uStack_118,2); if (iStack_c == -1) { uStack_120 = &UNK_00400f10; func_0x00400cc0(1); } uStack_120 = &UNK_00400f24; lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ef,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f34; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00400f44; func_0x00400c10(iStack_c); } return; }
['gcc']
52,711
void CWE367_TOC_TOU__stat_16_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94671/CWE367_TOC_TOU__stat_16.c
CWE367_TOC_TOU__stat_16_good
void CWE367_TOC_TOU__stat_16_good(void) { good1(); return; }
['gcc']
52,712
void CWE367_TOC_TOU__stat_17_bad() { int j; for(j = 0; j < 1; j++) { { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94672/CWE367_TOC_TOU__stat_17.c
CWE367_TOC_TOU__stat_17_bad
void CWE367_TOC_TOU__stat_17_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [152]; int iStack_10; int iStack_c; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_10 = 0xffffffff; uStack_120 = &UNK_00400e89; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e98; printLine(&UNK_00401500); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400ebc; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ee1; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ef0; func_0x00400cc0(1); } uStack_120 = &UNK_00400f09; iStack_10 = func_0x00400cb0(&uStack_118,2); if (iStack_10 == -1) { uStack_120 = &UNK_00400f1c; func_0x00400cc0(1); } uStack_120 = &UNK_00400f30; lVar2 = func_0x00400bd0(iStack_10,&UNK_0040150f,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f40; func_0x00400cc0(1); } if (iStack_10 != -1) { uStack_120 = &UNK_00400f50; func_0x00400c10(iStack_10); } } return; }
['gcc']
52,713
void CWE367_TOC_TOU__stat_17_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94672/CWE367_TOC_TOU__stat_17.c
CWE367_TOC_TOU__stat_17_good
void CWE367_TOC_TOU__stat_17_good(void) { good1(); return; }
['gcc']
52,714
void CWE367_TOC_TOU__stat_18_bad() { goto sink; sink: { char filename[100] = ""; struct STAT statBuffer; int fileDesc = -1; if (fgets(filename, 100, stdin) == NULL) { printLine("fgets() failed"); /* Restore NUL terminator if fgets fails */ filename[0] = '\0'; } if (strlen(filename) > 0) { filename[strlen(filename)-1] = '\0'; /* remove newline */ } /* FLAW: Open and write to the file after checking the status information */ if (STAT(filename, &statBuffer) == -1) { exit(1); } fileDesc = OPEN(filename, O_RDWR); if (fileDesc == -1) { exit(1); } if (WRITE(fileDesc, BAD_SINK_STRING, strlen(BAD_SINK_STRING)) == -1) { exit(1); } if (fileDesc != -1) { CLOSE(fileDesc); } } }
['/* Restore NUL terminator if fgets fails */', '/* remove newline */', '/* FLAW: Open and write to the file after checking the status information */']
['CWE367']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94673/CWE367_TOC_TOU__stat_18.c
CWE367_TOC_TOU__stat_18_bad
void CWE367_TOC_TOU__stat_18_bad(void) { int iVar1; long lVar2; undefined8 uStack_120; ulong uStack_118; undefined8 uStack_110; undefined8 uStack_108; undefined8 uStack_100; undefined8 uStack_f8; undefined8 uStack_f0; undefined8 uStack_e8; undefined8 uStack_e0; undefined8 uStack_d8; undefined8 uStack_d0; undefined8 uStack_c8; undefined8 uStack_c0; undefined4 uStack_b8; undefined auStack_a8 [156]; int iStack_c; uStack_118 = 0; uStack_110 = 0; uStack_108 = 0; uStack_100 = 0; uStack_f8 = 0; uStack_f0 = 0; uStack_e8 = 0; uStack_e0 = 0; uStack_d8 = 0; uStack_d0 = 0; uStack_c8 = 0; uStack_c0 = 0; uStack_b8 = 0; iStack_c = 0xffffffff; uStack_120 = &UNK_00400e7e; lVar2 = func_0x00400c40(&uStack_118,100,stdin); if (lVar2 == 0) { uStack_120 = &UNK_00400e8d; printLine(&UNK_004014e0); uStack_118 = uStack_118 & 0xffffffffffffff00; } if ((char)uStack_118 != '\0') { uStack_120 = &UNK_00400eb1; lVar2 = func_0x00400bf0(&uStack_118); *(undefined *)((long)&uStack_120 + lVar2 + 7) = 0; } uStack_120 = &UNK_00400ed6; iVar1 = stat(&uStack_118,auStack_a8); if (iVar1 == -1) { uStack_120 = &UNK_00400ee5; func_0x00400cc0(1); } uStack_120 = &UNK_00400efe; iStack_c = func_0x00400cb0(&uStack_118,2); if (iStack_c == -1) { uStack_120 = &UNK_00400f11; func_0x00400cc0(1); } uStack_120 = &UNK_00400f25; lVar2 = func_0x00400bd0(iStack_c,&UNK_004014ef,0xb); if (lVar2 == -1) { uStack_120 = &UNK_00400f35; func_0x00400cc0(1); } if (iStack_c != -1) { uStack_120 = &UNK_00400f45; func_0x00400c10(iStack_c); } return; }
['gcc']
52,715
void CWE367_TOC_TOU__stat_18_good() { good1(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94673/CWE367_TOC_TOU__stat_18.c
CWE367_TOC_TOU__stat_18_good
void CWE367_TOC_TOU__stat_18_good(void) { good1(); return; }
['gcc']
52,716
void CWE369_Divide_by_Zero__float_connect_socket_01_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94674/CWE369_Divide_by_Zero__float_connect_socket_01.c
CWE369_Divide_by_Zero__float_connect_socket_01_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_01_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401468); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_00401498 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,717
void CWE369_Divide_by_Zero__float_connect_socket_01_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94674/CWE369_Divide_by_Zero__float_connect_socket_01.c
CWE369_Divide_by_Zero__float_connect_socket_01_good
void CWE369_Divide_by_Zero__float_connect_socket_01_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,718
void CWE369_Divide_by_Zero__float_connect_socket_02_bad() { float data; /* Initialize data */ data = 0.0F; if(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(1) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94675/CWE369_Divide_by_Zero__float_connect_socket_02.c
CWE369_Divide_by_Zero__float_connect_socket_02_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_02_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401468); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_00401498 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,719
void CWE369_Divide_by_Zero__float_connect_socket_02_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94675/CWE369_Divide_by_Zero__float_connect_socket_02.c
CWE369_Divide_by_Zero__float_connect_socket_02_good
void CWE369_Divide_by_Zero__float_connect_socket_02_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,720
void CWE369_Divide_by_Zero__float_connect_socket_03_bad() { float data; /* Initialize data */ data = 0.0F; if(5==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(5==5) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94676/CWE369_Divide_by_Zero__float_connect_socket_03.c
CWE369_Divide_by_Zero__float_connect_socket_03_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_03_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401468); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_00401498 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,721
void CWE369_Divide_by_Zero__float_connect_socket_03_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94676/CWE369_Divide_by_Zero__float_connect_socket_03.c
CWE369_Divide_by_Zero__float_connect_socket_03_good
void CWE369_Divide_by_Zero__float_connect_socket_03_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,722
void CWE369_Divide_by_Zero__float_connect_socket_04_bad() { float data; /* Initialize data */ data = 0.0F; if(STATIC_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(STATIC_CONST_TRUE) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94677/CWE369_Divide_by_Zero__float_connect_socket_04.c
CWE369_Divide_by_Zero__float_connect_socket_04_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_04_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401480); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_004014b0 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,723
void CWE369_Divide_by_Zero__float_connect_socket_04_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94677/CWE369_Divide_by_Zero__float_connect_socket_04.c
CWE369_Divide_by_Zero__float_connect_socket_04_good
void CWE369_Divide_by_Zero__float_connect_socket_04_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,724
void CWE369_Divide_by_Zero__float_connect_socket_05_bad() { float data; /* Initialize data */ data = 0.0F; if(staticTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(staticTrue) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94678/CWE369_Divide_by_Zero__float_connect_socket_05.c
CWE369_Divide_by_Zero__float_connect_socket_05_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_05_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; if (staticTrue != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } if (staticTrue != 0) { iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,725
void CWE369_Divide_by_Zero__float_connect_socket_05_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94678/CWE369_Divide_by_Zero__float_connect_socket_05.c
CWE369_Divide_by_Zero__float_connect_socket_05_good
void CWE369_Divide_by_Zero__float_connect_socket_05_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,726
void CWE369_Divide_by_Zero__float_connect_socket_06_bad() { float data; /* Initialize data */ data = 0.0F; if(STATIC_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(STATIC_CONST_FIVE==5) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94679/CWE369_Divide_by_Zero__float_connect_socket_06.c
CWE369_Divide_by_Zero__float_connect_socket_06_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_06_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_0040147c); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,727
void CWE369_Divide_by_Zero__float_connect_socket_06_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94679/CWE369_Divide_by_Zero__float_connect_socket_06.c
CWE369_Divide_by_Zero__float_connect_socket_06_good
void CWE369_Divide_by_Zero__float_connect_socket_06_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,728
void CWE369_Divide_by_Zero__float_connect_socket_07_bad() { float data; /* Initialize data */ data = 0.0F; if(staticFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(staticFive==5) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94680/CWE369_Divide_by_Zero__float_connect_socket_07.c
CWE369_Divide_by_Zero__float_connect_socket_07_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_07_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; if (staticFive == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } if (staticFive == 5) { iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,729
void CWE369_Divide_by_Zero__float_connect_socket_07_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94680/CWE369_Divide_by_Zero__float_connect_socket_07.c
CWE369_Divide_by_Zero__float_connect_socket_07_good
void CWE369_Divide_by_Zero__float_connect_socket_07_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,730
void CWE369_Divide_by_Zero__float_connect_socket_08_bad() { float data; /* Initialize data */ data = 0.0F; if(staticReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(staticReturnsTrue()) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94681/CWE369_Divide_by_Zero__float_connect_socket_08.c
CWE369_Divide_by_Zero__float_connect_socket_08_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_08_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401498); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } iVar1 = staticReturnsTrue(); if (iVar1 != 0) { iStack_18 = (int)(_UNK_004014c8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,731
void CWE369_Divide_by_Zero__float_connect_socket_08_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94681/CWE369_Divide_by_Zero__float_connect_socket_08.c
CWE369_Divide_by_Zero__float_connect_socket_08_good
void CWE369_Divide_by_Zero__float_connect_socket_08_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,732
void CWE369_Divide_by_Zero__float_connect_socket_09_bad() { float data; /* Initialize data */ data = 0.0F; if(GLOBAL_CONST_TRUE) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(GLOBAL_CONST_TRUE) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94682/CWE369_Divide_by_Zero__float_connect_socket_09.c
CWE369_Divide_by_Zero__float_connect_socket_09_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_09_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; if (GLOBAL_CONST_TRUE != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } if (GLOBAL_CONST_TRUE != 0) { iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,733
void CWE369_Divide_by_Zero__float_connect_socket_09_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94682/CWE369_Divide_by_Zero__float_connect_socket_09.c
CWE369_Divide_by_Zero__float_connect_socket_09_good
void CWE369_Divide_by_Zero__float_connect_socket_09_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,734
void CWE369_Divide_by_Zero__float_connect_socket_10_bad() { float data; /* Initialize data */ data = 0.0F; if(globalTrue) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(globalTrue) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94683/CWE369_Divide_by_Zero__float_connect_socket_10.c
CWE369_Divide_by_Zero__float_connect_socket_10_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_10_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; if (globalTrue != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } if (globalTrue != 0) { iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,735
void CWE369_Divide_by_Zero__float_connect_socket_10_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94683/CWE369_Divide_by_Zero__float_connect_socket_10.c
CWE369_Divide_by_Zero__float_connect_socket_10_good
void CWE369_Divide_by_Zero__float_connect_socket_10_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,736
void CWE369_Divide_by_Zero__float_connect_socket_11_bad() { float data; /* Initialize data */ data = 0.0F; if(globalReturnsTrue()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(globalReturnsTrue()) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94684/CWE369_Divide_by_Zero__float_connect_socket_11.c
CWE369_Divide_by_Zero__float_connect_socket_11_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_11_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401488); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } iVar1 = globalReturnsTrue(); if (iVar1 != 0) { iStack_18 = (int)(_UNK_004014b8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,737
void CWE369_Divide_by_Zero__float_connect_socket_11_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94684/CWE369_Divide_by_Zero__float_connect_socket_11.c
CWE369_Divide_by_Zero__float_connect_socket_11_good
void CWE369_Divide_by_Zero__float_connect_socket_11_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,738
void CWE369_Divide_by_Zero__float_connect_socket_12_bad() { float data; /* Initialize data */ data = 0.0F; if(globalReturnsTrueOrFalse()) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } else { /* FIX: Use a hardcoded number that won't a divide by zero */ data = 2.0F; } if(globalReturnsTrueOrFalse()) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } else { /* FIX: Check for value of or near zero before dividing */ if(fabs(data) > 0.000001) { int result = (int)(100.0 / data); printIntLine(result); } else { printLine("This would result in a divide by zero"); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', "/* FIX: Use a hardcoded number that won't a divide by zero */", '/* POTENTIAL FLAW: Possibly divide by zero */', '/* FIX: Check for value of or near zero before dividing */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94685/CWE369_Divide_by_Zero__float_connect_socket_12.c
CWE369_Divide_by_Zero__float_connect_socket_12_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_12_bad(void) { int iVar1; double dVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_1c; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { fStack_c = _UNK_00401538; } else { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400c70(&UNK_004014e0); uStack_36 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_58,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_58[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_58); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } iVar1 = globalReturnsTrueOrFalse(); if (iVar1 == 0) { if ((double)(float)((uint)fStack_c & _UNK_00401550) <= _UNK_00401560) { printLine(&UNK_004014f0); } else { iStack_18 = (int)(_UNK_00401540 / (double)fStack_c); printIntLine(iStack_18); } } else { iStack_1c = (int)(_UNK_00401540 / (double)fStack_c); printIntLine(iStack_1c); } return; }
['gcc']
52,739
void CWE369_Divide_by_Zero__float_connect_socket_12_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94685/CWE369_Divide_by_Zero__float_connect_socket_12.c
CWE369_Divide_by_Zero__float_connect_socket_12_good
void CWE369_Divide_by_Zero__float_connect_socket_12_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
52,740
void CWE369_Divide_by_Zero__float_connect_socket_13_bad() { float data; /* Initialize data */ data = 0.0F; if(GLOBAL_CONST_FIVE==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(GLOBAL_CONST_FIVE==5) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94686/CWE369_Divide_by_Zero__float_connect_socket_13.c
CWE369_Divide_by_Zero__float_connect_socket_13_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_13_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; if (GLOBAL_CONST_FIVE == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } if (GLOBAL_CONST_FIVE == 5) { iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,741
void CWE369_Divide_by_Zero__float_connect_socket_13_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94686/CWE369_Divide_by_Zero__float_connect_socket_13.c
CWE369_Divide_by_Zero__float_connect_socket_13_good
void CWE369_Divide_by_Zero__float_connect_socket_13_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,742
void CWE369_Divide_by_Zero__float_connect_socket_14_bad() { float data; /* Initialize data */ data = 0.0F; if(globalFive==5) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } if(globalFive==5) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94687/CWE369_Divide_by_Zero__float_connect_socket_14.c
CWE369_Divide_by_Zero__float_connect_socket_14_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_14_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; if (globalFive == 5) { iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } } if (globalFive == 5) { iStack_18 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_18); } return; }
['gcc']
52,743
void CWE369_Divide_by_Zero__float_connect_socket_14_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94687/CWE369_Divide_by_Zero__float_connect_socket_14.c
CWE369_Divide_by_Zero__float_connect_socket_14_good
void CWE369_Divide_by_Zero__float_connect_socket_14_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,744
void CWE369_Divide_by_Zero__float_connect_socket_15_bad() { float data; /* Initialize data */ data = 0.0F; switch(6) { case 6: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } switch(7) { case 7: { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } break; default: /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); break; } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* POTENTIAL FLAW: Possibly divide by zero */', '/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94688/CWE369_Divide_by_Zero__float_connect_socket_15.c
CWE369_Divide_by_Zero__float_connect_socket_15_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_15_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401468); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_00401498 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,745
void CWE369_Divide_by_Zero__float_connect_socket_15_good() { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94688/CWE369_Divide_by_Zero__float_connect_socket_15.c
CWE369_Divide_by_Zero__float_connect_socket_15_good
void CWE369_Divide_by_Zero__float_connect_socket_15_good(void) { goodB2G1(); goodB2G2(); goodG2B1(); goodG2B2(); return; }
['gcc']
52,746
void CWE369_Divide_by_Zero__float_connect_socket_16_bad() { float data; /* Initialize data */ data = 0.0F; while(1) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } break; } while(1) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } break; } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94689/CWE369_Divide_by_Zero__float_connect_socket_16.c
CWE369_Divide_by_Zero__float_connect_socket_16_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_16_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401468); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_00401498 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,747
void CWE369_Divide_by_Zero__float_connect_socket_16_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94689/CWE369_Divide_by_Zero__float_connect_socket_16.c
CWE369_Divide_by_Zero__float_connect_socket_16_good
void CWE369_Divide_by_Zero__float_connect_socket_16_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
52,748
void CWE369_Divide_by_Zero__float_connect_socket_17_bad() { int i,j; float data; /* Initialize data */ data = 0.0F; for(i = 0; i < 1; i++) { { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } } for(j = 0; j < 1; j++) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94690/CWE369_Divide_by_Zero__float_connect_socket_17.c
CWE369_Divide_by_Zero__float_connect_socket_17_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_17_bad(void) { int iVar1; double dVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; int iStack_18; float fStack_14; int iStack_10; int iStack_c; fStack_14 = 0.0; for (iStack_c = 0; iStack_c < 1; iStack_c = iStack_c + 1) { iStack_1c = 0xffffffff; iStack_1c = func_0x00400cf0(2,1,6); if (iStack_1c != -1) { func_0x00400c20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400c70(&UNK_00401488); uStack_36 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400bc0(iStack_1c,auStack_58,0x13,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_58[iStack_20] = 0; dVar2 = (double)func_0x00400be0(auStack_58); fStack_14 = (float)dVar2; } } if (iStack_1c != -1) { func_0x00400c30(iStack_1c); } } for (iStack_10 = 0; iStack_10 < 1; iStack_10 = iStack_10 + 1) { iStack_18 = (int)(_UNK_004014b8 / (double)fStack_14); printIntLine(iStack_18); } return; }
['gcc']
52,749
void CWE369_Divide_by_Zero__float_connect_socket_17_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94690/CWE369_Divide_by_Zero__float_connect_socket_17.c
CWE369_Divide_by_Zero__float_connect_socket_17_good
void CWE369_Divide_by_Zero__float_connect_socket_17_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
52,750
void CWE369_Divide_by_Zero__float_connect_socket_18_bad() { float data; /* Initialize data */ data = 0.0F; goto source; source: { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } goto sink; sink: { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94691/CWE369_Divide_by_Zero__float_connect_socket_18.c
CWE369_Divide_by_Zero__float_connect_socket_18_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_18_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401468); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } iStack_18 = (int)(_UNK_00401498 / (double)fStack_c); printIntLine(iStack_18); return; }
['gcc']
52,751
void CWE369_Divide_by_Zero__float_connect_socket_18_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94691/CWE369_Divide_by_Zero__float_connect_socket_18.c
CWE369_Divide_by_Zero__float_connect_socket_18_good
void CWE369_Divide_by_Zero__float_connect_socket_18_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
52,752
void CWE369_Divide_by_Zero__float_connect_socket_21_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } badStatic = 1; /* true */ badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* true */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94692/CWE369_Divide_by_Zero__float_connect_socket_21.c
CWE369_Divide_by_Zero__float_connect_socket_21_bad
void CWE369_Divide_by_Zero__float_connect_socket_21_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401498); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } badStatic = 1; badSink(fStack_c); return; }
['gcc']
52,753
void CWE369_Divide_by_Zero__float_connect_socket_21_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94692/CWE369_Divide_by_Zero__float_connect_socket_21.c
CWE369_Divide_by_Zero__float_connect_socket_21_good
void CWE369_Divide_by_Zero__float_connect_socket_21_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']
52,754
void CWE369_Divide_by_Zero__float_connect_socket_22_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE369_Divide_by_Zero__float_connect_socket_22_badGlobal = 1; /* true */ CWE369_Divide_by_Zero__float_connect_socket_22_badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* true */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94693/CWE369_Divide_by_Zero__float_connect_socket_22a.c
CWE369_Divide_by_Zero__float_connect_socket_22_bad
void CWE369_Divide_by_Zero__float_connect_socket_22_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401494); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } CWE369_Divide_by_Zero__float_connect_socket_22_badGlobal = 1; CWE369_Divide_by_Zero__float_connect_socket_22_badSink(fStack_c); return; }
['gcc']
52,755
void CWE369_Divide_by_Zero__float_connect_socket_22_good() { goodB2G1(); goodB2G2(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94693/CWE369_Divide_by_Zero__float_connect_socket_22a.c
CWE369_Divide_by_Zero__float_connect_socket_22_good
void CWE369_Divide_by_Zero__float_connect_socket_22_good(void) { goodB2G1(); goodB2G2(); goodG2B(); return; }
['gcc']
52,756
void CWE369_Divide_by_Zero__float_connect_socket_22_badSink(float data) { if(CWE369_Divide_by_Zero__float_connect_socket_22_badGlobal) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94693/CWE369_Divide_by_Zero__float_connect_socket_22b.c
CWE369_Divide_by_Zero__float_connect_socket_22_badSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_22_badSink(float param_1) { if (CWE369_Divide_by_Zero__float_connect_socket_22_badGlobal != 0) { printIntLine((int)(_UNK_00401498 / (double)param_1)); } return; }
['gcc']
52,757
void CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G1Sink(float data) { if(CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G1Global) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ printLine("Benign, fixed string"); } else { /* FIX: Check for value of or near zero before dividing */ if(fabs(data) > 0.000001) { int result = (int)(100.0 / data); printIntLine(result); } else { printLine("This would result in a divide by zero"); } } }
['/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */', '/* FIX: Check for value of or near zero before dividing */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94693/CWE369_Divide_by_Zero__float_connect_socket_22b.c
CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G1Sink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G1Sink(float param_1) { if (CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G1Global == 0) { if ((double)(float)((uint)param_1 & _UNK_00401710) <= _UNK_00401720) { printLine(&UNK_004016e8); } else { printIntLine((int)(_UNK_00401728 / (double)param_1)); } } else { printLine(&UNK_004016d0); } return; }
['gcc']
52,758
void CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G2Sink(float data) { if(CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G2Global) { /* FIX: Check for value of or near zero before dividing */ if(fabs(data) > 0.000001) { int result = (int)(100.0 / data); printIntLine(result); } else { printLine("This would result in a divide by zero"); } } }
['/* FIX: Check for value of or near zero before dividing */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94693/CWE369_Divide_by_Zero__float_connect_socket_22b.c
CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G2Sink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G2Sink(float param_1) { if (CWE369_Divide_by_Zero__float_connect_socket_22_goodB2G2Global != 0) { if ((double)(float)((uint)param_1 & _UNK_00401710) <= _UNK_00401720) { printLine(&UNK_004016e8); } else { printIntLine((int)(_UNK_00401728 / (double)param_1)); } } return; }
['gcc']
52,759
void CWE369_Divide_by_Zero__float_connect_socket_22_goodG2BSink(float data) { if(CWE369_Divide_by_Zero__float_connect_socket_22_goodG2BGlobal) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94693/CWE369_Divide_by_Zero__float_connect_socket_22b.c
CWE369_Divide_by_Zero__float_connect_socket_22_goodG2BSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_22_goodG2BSink(float param_1) { if (CWE369_Divide_by_Zero__float_connect_socket_22_goodG2BGlobal != 0) { printIntLine((int)(_UNK_00401728 / (double)param_1)); } return; }
['gcc']
52,760
void CWE369_Divide_by_Zero__float_connect_socket_31_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } { float dataCopy = data; float data = dataCopy; { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94694/CWE369_Divide_by_Zero__float_connect_socket_31.c
CWE369_Divide_by_Zero__float_connect_socket_31_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_31_bad(void) { int iVar1; double dVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; float fStack_1c; float fStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400c70(&UNK_00401478); uStack_36 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_58,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_58[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_58); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } fStack_18 = fStack_c; fStack_1c = fStack_c; iStack_20 = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_20); return; }
['gcc']
52,761
void CWE369_Divide_by_Zero__float_connect_socket_31_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94694/CWE369_Divide_by_Zero__float_connect_socket_31.c
CWE369_Divide_by_Zero__float_connect_socket_31_good
void CWE369_Divide_by_Zero__float_connect_socket_31_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,762
void CWE369_Divide_by_Zero__float_connect_socket_32_bad() { float data; float *dataPtr1 = &data; float *dataPtr2 = &data; /* Initialize data */ data = 0.0F; { float data = *dataPtr1; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } *dataPtr1 = data; } { float data = *dataPtr2; { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94695/CWE369_Divide_by_Zero__float_connect_socket_32.c
CWE369_Divide_by_Zero__float_connect_socket_32_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ /* WARNING: Restarted to delay deadcode elimination for space: stack */ void CWE369_Divide_by_Zero__float_connect_socket_32_bad(void) { int iVar1; double dVar2; undefined auStack_68 [32]; undefined2 uStack_48; undefined2 uStack_46; undefined4 uStack_44; float fStack_34; int iStack_30; float fStack_2c; int iStack_28; int iStack_24; float *pfStack_20; float *pfStack_18; float fStack_c; pfStack_18 = &fStack_34; pfStack_20 = &fStack_34; fStack_34 = 0.0; fStack_c = 0.0; iStack_24 = 0xffffffff; iStack_24 = func_0x00400cf0(2,1,6); if (iStack_24 != -1) { func_0x00400c20(&uStack_48,0,0x10); uStack_48 = 2; uStack_44 = func_0x00400c70(&UNK_00401498); uStack_46 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_24,&uStack_48,0x10); if (((iVar1 != -1) && (iStack_28 = func_0x00400bc0(iStack_24,auStack_68,0x13,0), iStack_28 != -1)) && (iStack_28 != 0)) { auStack_68[iStack_28] = 0; dVar2 = (double)func_0x00400be0(auStack_68); fStack_c = (float)dVar2; } } if (iStack_24 != -1) { func_0x00400c30(iStack_24); } *pfStack_18 = fStack_c; fStack_2c = *pfStack_20; iStack_30 = (int)(_UNK_004014c8 / (double)fStack_2c); printIntLine(iStack_30); return; }
['gcc']
52,763
void CWE369_Divide_by_Zero__float_connect_socket_32_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94695/CWE369_Divide_by_Zero__float_connect_socket_32.c
CWE369_Divide_by_Zero__float_connect_socket_32_good
void CWE369_Divide_by_Zero__float_connect_socket_32_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,764
void CWE369_Divide_by_Zero__float_connect_socket_34_bad() { float data; CWE369_Divide_by_Zero__float_connect_socket_34_unionType myUnion; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } myUnion.unionFirst = data; { float data = myUnion.unionSecond; { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } } }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94697/CWE369_Divide_by_Zero__float_connect_socket_34.c
CWE369_Divide_by_Zero__float_connect_socket_34_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_34_bad(void) { int iVar1; double dVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; float fStack_20; int iStack_1c; float fStack_18; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400c70(&UNK_00401478); uStack_36 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_58,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_58[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_58); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } fStack_20 = fStack_c; fStack_18 = fStack_c; iStack_1c = (int)(_UNK_004014a8 / (double)fStack_c); printIntLine(iStack_1c); return; }
['gcc']
52,765
void CWE369_Divide_by_Zero__float_connect_socket_34_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94697/CWE369_Divide_by_Zero__float_connect_socket_34.c
CWE369_Divide_by_Zero__float_connect_socket_34_good
void CWE369_Divide_by_Zero__float_connect_socket_34_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,766
void CWE369_Divide_by_Zero__float_connect_socket_41_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94698/CWE369_Divide_by_Zero__float_connect_socket_41.c
CWE369_Divide_by_Zero__float_connect_socket_41_bad
void CWE369_Divide_by_Zero__float_connect_socket_41_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401478); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } badSink(fStack_c); return; }
['gcc']
52,767
void CWE369_Divide_by_Zero__float_connect_socket_41_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94698/CWE369_Divide_by_Zero__float_connect_socket_41.c
CWE369_Divide_by_Zero__float_connect_socket_41_good
void CWE369_Divide_by_Zero__float_connect_socket_41_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
52,768
void CWE369_Divide_by_Zero__float_connect_socket_42_bad() { float data; /* Initialize data */ data = 0.0F; data = badSource(data); { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* Initialize data */', '/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94699/CWE369_Divide_by_Zero__float_connect_socket_42.c
CWE369_Divide_by_Zero__float_connect_socket_42_bad
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_42_bad(void) { float fVar1; fVar1 = (float)badSource(0); printIntLine((int)(_UNK_004014b8 / (double)fVar1)); return; }
['gcc']
52,769
void CWE369_Divide_by_Zero__float_connect_socket_42_good() { goodB2G(); goodG2B(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94699/CWE369_Divide_by_Zero__float_connect_socket_42.c
CWE369_Divide_by_Zero__float_connect_socket_42_good
void CWE369_Divide_by_Zero__float_connect_socket_42_good(void) { goodB2G(); goodG2B(); return; }
['gcc']
52,770
void CWE369_Divide_by_Zero__float_connect_socket_44_bad() { float data; /* define a function pointer */ void (*funcPtr) (float) = badSink; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } /* use the function pointer */ funcPtr(data); }
['/* define a function pointer */', '/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */', '/* use the function pointer */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94701/CWE369_Divide_by_Zero__float_connect_socket_44.c
CWE369_Divide_by_Zero__float_connect_socket_44_bad
void CWE369_Divide_by_Zero__float_connect_socket_44_bad(void) { int iVar1; double dVar2; undefined auStack_58 [32]; undefined2 uStack_38; undefined2 uStack_36; undefined4 uStack_34; int iStack_20; int iStack_1c; code *pcStack_18; float fStack_c; pcStack_18 = badSink; fStack_c = 0.0; iStack_1c = 0xffffffff; iStack_1c = func_0x00400cf0(2,1,6); if (iStack_1c != -1) { func_0x00400c20(&uStack_38,0,0x10); uStack_38 = 2; uStack_34 = func_0x00400c70(&UNK_00401488); uStack_36 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_1c,&uStack_38,0x10); if (((iVar1 != -1) && (iStack_20 = func_0x00400bc0(iStack_1c,auStack_58,0x13,0), iStack_20 != -1)) && (iStack_20 != 0)) { auStack_58[iStack_20] = 0; dVar2 = (double)func_0x00400be0(auStack_58); fStack_c = (float)dVar2; } } if (iStack_1c != -1) { func_0x00400c30(iStack_1c); } (*pcStack_18)(fStack_c); return; }
['gcc']
52,771
void CWE369_Divide_by_Zero__float_connect_socket_44_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94701/CWE369_Divide_by_Zero__float_connect_socket_44.c
CWE369_Divide_by_Zero__float_connect_socket_44_good
void CWE369_Divide_by_Zero__float_connect_socket_44_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,772
void CWE369_Divide_by_Zero__float_connect_socket_45_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE369_Divide_by_Zero__float_connect_socket_45_badData = data; badSink(); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94702/CWE369_Divide_by_Zero__float_connect_socket_45.c
CWE369_Divide_by_Zero__float_connect_socket_45_bad
void CWE369_Divide_by_Zero__float_connect_socket_45_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401488); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } CWE369_Divide_by_Zero__float_connect_socket_45_badData = fStack_c; badSink(); return; }
['gcc']
52,773
void CWE369_Divide_by_Zero__float_connect_socket_45_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94702/CWE369_Divide_by_Zero__float_connect_socket_45.c
CWE369_Divide_by_Zero__float_connect_socket_45_good
void CWE369_Divide_by_Zero__float_connect_socket_45_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,774
void CWE369_Divide_by_Zero__float_connect_socket_51_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE369_Divide_by_Zero__float_connect_socket_51b_badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94703/CWE369_Divide_by_Zero__float_connect_socket_51a.c
CWE369_Divide_by_Zero__float_connect_socket_51_bad
void CWE369_Divide_by_Zero__float_connect_socket_51_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401474); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } CWE369_Divide_by_Zero__float_connect_socket_51b_badSink(fStack_c); return; }
['gcc']
52,775
void CWE369_Divide_by_Zero__float_connect_socket_51_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94703/CWE369_Divide_by_Zero__float_connect_socket_51a.c
CWE369_Divide_by_Zero__float_connect_socket_51_good
void CWE369_Divide_by_Zero__float_connect_socket_51_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,776
void CWE369_Divide_by_Zero__float_connect_socket_51b_badSink(float data) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94703/CWE369_Divide_by_Zero__float_connect_socket_51b.c
CWE369_Divide_by_Zero__float_connect_socket_51b_badSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_51b_badSink(float param_1) { printIntLine((int)(_UNK_00401478 / (double)param_1)); return; }
['gcc']
52,777
void CWE369_Divide_by_Zero__float_connect_socket_51b_goodG2BSink(float data) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94703/CWE369_Divide_by_Zero__float_connect_socket_51b.c
CWE369_Divide_by_Zero__float_connect_socket_51b_goodG2BSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_51b_goodG2BSink(float param_1) { printIntLine((int)(_UNK_00401558 / (double)param_1)); return; }
['gcc']
52,778
void CWE369_Divide_by_Zero__float_connect_socket_51b_goodB2GSink(float data) { /* FIX: Check for value of or near zero before dividing */ if(fabs(data) > 0.000001) { int result = (int)(100.0 / data); printIntLine(result); } else { printLine("This would result in a divide by zero"); } }
['/* FIX: Check for value of or near zero before dividing */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94703/CWE369_Divide_by_Zero__float_connect_socket_51b.c
CWE369_Divide_by_Zero__float_connect_socket_51b_goodB2GSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_51b_goodB2GSink(float param_1) { if ((double)(float)((uint)param_1 & _UNK_00401560) <= _UNK_00401570) { printLine(&UNK_00401530); } else { printIntLine((int)(_UNK_00401558 / (double)param_1)); } return; }
['gcc']
52,779
void CWE369_Divide_by_Zero__float_connect_socket_52_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE369_Divide_by_Zero__float_connect_socket_52b_badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52a.c
CWE369_Divide_by_Zero__float_connect_socket_52_bad
void CWE369_Divide_by_Zero__float_connect_socket_52_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_00401494); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } CWE369_Divide_by_Zero__float_connect_socket_52b_badSink(fStack_c); return; }
['gcc']
52,780
void CWE369_Divide_by_Zero__float_connect_socket_52_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52a.c
CWE369_Divide_by_Zero__float_connect_socket_52_good
void CWE369_Divide_by_Zero__float_connect_socket_52_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,781
void CWE369_Divide_by_Zero__float_connect_socket_52b_badSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_52c_badSink(data); }
[]
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52b.c
CWE369_Divide_by_Zero__float_connect_socket_52b_badSink
void CWE369_Divide_by_Zero__float_connect_socket_52b_badSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_52c_badSink(param_1); return; }
['gcc']
52,782
void CWE369_Divide_by_Zero__float_connect_socket_52b_goodG2BSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_52c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52b.c
CWE369_Divide_by_Zero__float_connect_socket_52b_goodG2BSink
void CWE369_Divide_by_Zero__float_connect_socket_52b_goodG2BSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_52c_goodG2BSink(param_1); return; }
['gcc']
52,783
void CWE369_Divide_by_Zero__float_connect_socket_52b_goodB2GSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_52c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52b.c
CWE369_Divide_by_Zero__float_connect_socket_52b_goodB2GSink
void CWE369_Divide_by_Zero__float_connect_socket_52b_goodB2GSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_52c_goodB2GSink(param_1); return; }
['gcc']
52,784
void CWE369_Divide_by_Zero__float_connect_socket_52c_badSink(float data) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52c.c
CWE369_Divide_by_Zero__float_connect_socket_52c_badSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_52c_badSink(float param_1) { printIntLine((int)(_UNK_00401498 / (double)param_1)); return; }
['gcc']
52,785
void CWE369_Divide_by_Zero__float_connect_socket_52c_goodG2BSink(float data) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52c.c
CWE369_Divide_by_Zero__float_connect_socket_52c_goodG2BSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_52c_goodG2BSink(float param_1) { printIntLine((int)(_UNK_00401588 / (double)param_1)); return; }
['gcc']
52,786
void CWE369_Divide_by_Zero__float_connect_socket_52c_goodB2GSink(float data) { /* FIX: Check for value of or near zero before dividing */ if(fabs(data) > 0.000001) { int result = (int)(100.0 / data); printIntLine(result); } else { printLine("This would result in a divide by zero"); } }
['/* FIX: Check for value of or near zero before dividing */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94704/CWE369_Divide_by_Zero__float_connect_socket_52c.c
CWE369_Divide_by_Zero__float_connect_socket_52c_goodB2GSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_52c_goodB2GSink(float param_1) { if ((double)(float)((uint)param_1 & _UNK_00401590) <= _UNK_004015a0) { printLine(&UNK_00401560); } else { printIntLine((int)(_UNK_00401588 / (double)param_1)); } return; }
['gcc']
52,787
void CWE369_Divide_by_Zero__float_connect_socket_53_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE369_Divide_by_Zero__float_connect_socket_53b_badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53a.c
CWE369_Divide_by_Zero__float_connect_socket_53_bad
void CWE369_Divide_by_Zero__float_connect_socket_53_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_004014b4); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } CWE369_Divide_by_Zero__float_connect_socket_53b_badSink(fStack_c); return; }
['gcc']
52,788
void CWE369_Divide_by_Zero__float_connect_socket_53_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53a.c
CWE369_Divide_by_Zero__float_connect_socket_53_good
void CWE369_Divide_by_Zero__float_connect_socket_53_good(void) { goodG2B(); goodB2G(); return; }
['gcc']
52,789
void CWE369_Divide_by_Zero__float_connect_socket_53b_badSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_53c_badSink(data); }
[]
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53b.c
CWE369_Divide_by_Zero__float_connect_socket_53b_badSink
void CWE369_Divide_by_Zero__float_connect_socket_53b_badSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_53c_badSink(param_1); return; }
['gcc']
52,790
void CWE369_Divide_by_Zero__float_connect_socket_53b_goodG2BSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_53c_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53b.c
CWE369_Divide_by_Zero__float_connect_socket_53b_goodG2BSink
void CWE369_Divide_by_Zero__float_connect_socket_53b_goodG2BSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_53c_goodG2BSink(param_1); return; }
['gcc']
52,791
void CWE369_Divide_by_Zero__float_connect_socket_53b_goodB2GSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_53c_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53b.c
CWE369_Divide_by_Zero__float_connect_socket_53b_goodB2GSink
void CWE369_Divide_by_Zero__float_connect_socket_53b_goodB2GSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_53c_goodB2GSink(param_1); return; }
['gcc']
52,792
void CWE369_Divide_by_Zero__float_connect_socket_53c_badSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_53d_badSink(data); }
[]
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53c.c
CWE369_Divide_by_Zero__float_connect_socket_53c_badSink
void CWE369_Divide_by_Zero__float_connect_socket_53c_badSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_53d_badSink(param_1); return; }
['gcc']
52,793
void CWE369_Divide_by_Zero__float_connect_socket_53c_goodG2BSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_53d_goodG2BSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53c.c
CWE369_Divide_by_Zero__float_connect_socket_53c_goodG2BSink
void CWE369_Divide_by_Zero__float_connect_socket_53c_goodG2BSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_53d_goodG2BSink(param_1); return; }
['gcc']
52,794
void CWE369_Divide_by_Zero__float_connect_socket_53c_goodB2GSink(float data) { CWE369_Divide_by_Zero__float_connect_socket_53d_goodB2GSink(data); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53c.c
CWE369_Divide_by_Zero__float_connect_socket_53c_goodB2GSink
void CWE369_Divide_by_Zero__float_connect_socket_53c_goodB2GSink(undefined4 param_1) { CWE369_Divide_by_Zero__float_connect_socket_53d_goodB2GSink(param_1); return; }
['gcc']
52,795
void CWE369_Divide_by_Zero__float_connect_socket_53d_badSink(float data) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53d.c
CWE369_Divide_by_Zero__float_connect_socket_53d_badSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_53d_badSink(float param_1) { printIntLine((int)(_UNK_004014b8 / (double)param_1)); return; }
['gcc']
52,796
void CWE369_Divide_by_Zero__float_connect_socket_53d_goodG2BSink(float data) { { /* POTENTIAL FLAW: Possibly divide by zero */ int result = (int)(100.0 / data); printIntLine(result); } }
['/* POTENTIAL FLAW: Possibly divide by zero */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53d.c
CWE369_Divide_by_Zero__float_connect_socket_53d_goodG2BSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_53d_goodG2BSink(float param_1) { printIntLine((int)(_UNK_004015c8 / (double)param_1)); return; }
['gcc']
52,797
void CWE369_Divide_by_Zero__float_connect_socket_53d_goodB2GSink(float data) { /* FIX: Check for value of or near zero before dividing */ if(fabs(data) > 0.000001) { int result = (int)(100.0 / data); printIntLine(result); } else { printLine("This would result in a divide by zero"); } }
['/* FIX: Check for value of or near zero before dividing */']
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94705/CWE369_Divide_by_Zero__float_connect_socket_53d.c
CWE369_Divide_by_Zero__float_connect_socket_53d_goodB2GSink
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */ void CWE369_Divide_by_Zero__float_connect_socket_53d_goodB2GSink(float param_1) { if ((double)(float)((uint)param_1 & _UNK_004015d0) <= _UNK_004015e0) { printLine(&UNK_004015a0); } else { printIntLine((int)(_UNK_004015c8 / (double)param_1)); } return; }
['gcc']
52,798
void CWE369_Divide_by_Zero__float_connect_socket_54_bad() { float data; /* Initialize data */ data = 0.0F; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET connectSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif connectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connectSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = inet_addr(IP_ADDRESS); service.sin_port = htons(TCP_PORT); if (connect(connectSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed, make sure to recv one * less char than is in the recv_buf in order to append a terminator */ /* POTENTIAL FLAW: Use a value input from the network */ recvResult = recv(connectSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate string */ inputBuffer[recvResult] = '\0'; /* Convert to float */ data = (float)atof(inputBuffer); } while (0); if (connectSocket != INVALID_SOCKET) { CLOSE_SOCKET(connectSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE369_Divide_by_Zero__float_connect_socket_54b_badSink(data); }
['/* Initialize data */', '/* Abort on error or the connection was closed, make sure to recv one\r\n * less char than is in the recv_buf in order to append a terminator */', '/* POTENTIAL FLAW: Use a value input from the network */', '/* NUL-terminate string */', '/* Convert to float */']
['CWE369']
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94706/CWE369_Divide_by_Zero__float_connect_socket_54a.c
CWE369_Divide_by_Zero__float_connect_socket_54_bad
void CWE369_Divide_by_Zero__float_connect_socket_54_bad(void) { int iVar1; double dVar2; undefined auStack_48 [32]; undefined2 uStack_28; undefined2 uStack_26; undefined4 uStack_24; int iStack_14; int iStack_10; float fStack_c; fStack_c = 0.0; iStack_10 = 0xffffffff; iStack_10 = func_0x00400cf0(2,1,6); if (iStack_10 != -1) { func_0x00400c20(&uStack_28,0,0x10); uStack_28 = 2; uStack_24 = func_0x00400c70(&UNK_004014d4); uStack_26 = func_0x00400c00(0x6987); iVar1 = func_0x00400cc0(iStack_10,&uStack_28,0x10); if (((iVar1 != -1) && (iStack_14 = func_0x00400bc0(iStack_10,auStack_48,0x13,0), iStack_14 != -1)) && (iStack_14 != 0)) { auStack_48[iStack_14] = 0; dVar2 = (double)func_0x00400be0(auStack_48); fStack_c = (float)dVar2; } } if (iStack_10 != -1) { func_0x00400c30(iStack_10); } CWE369_Divide_by_Zero__float_connect_socket_54b_badSink(fStack_c); return; }
['gcc']
52,799
void CWE369_Divide_by_Zero__float_connect_socket_54_good() { goodG2B(); goodB2G(); }
[]
null
mvd
/work/xgk011/.cache/huggingface/datasets/downloads/extracted/486fbd3d4a8ebc225e93d9cfb666bef6ac127e67788d52f03aa0e741860aa84a/muVulDeePecker-master/source files/upload_source_1/94706/CWE369_Divide_by_Zero__float_connect_socket_54a.c
CWE369_Divide_by_Zero__float_connect_socket_54_good
void CWE369_Divide_by_Zero__float_connect_socket_54_good(void) { goodG2B(); goodB2G(); return; }
['gcc']