Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/wavtool-pl-0.20150501/src/wfh.c Examining data/wavtool-pl-0.20150501/src/wavtool-pl.c Examining data/wavtool-pl-0.20150501/src/wfh.h Examining data/wavtool-pl-0.20150501/src/wfd.c Examining data/wavtool-pl-0.20150501/src/wfd.h FINAL RESULTS: data/wavtool-pl-0.20150501/src/wavtool-pl.c:44:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file1 = fopen(filename,"r"); data/wavtool-pl-0.20150501/src/wavtool-pl.c:57:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp1[1024]; data/wavtool-pl-0.20150501/src/wfd.c:36:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file1 = fopen(filename,"w"); data/wavtool-pl-0.20150501/src/wfd.c:148:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). outfile = fopen(outputfilename,"r+b"); data/wavtool-pl-0.20150501/src/wfh.c:78:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file1 = fopen(filename,"wb"); data/wavtool-pl-0.20150501/src/wfh.c:113:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char com1[100]; data/wavtool-pl-0.20150501/src/wfh.c:115:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file1=fopen(filename,"rb"); data/wavtool-pl-0.20150501/src/wfh.c:186:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char com1[100]; data/wavtool-pl-0.20150501/src/wfh.c:188:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file1=fopen(filename,"r+b"); data/wavtool-pl-0.20150501/src/wavtool-pl.c:60:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(lenstr); data/wavtool-pl-0.20150501/src/wavtool-pl.c:90:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp1,lenstr,indexofAt); data/wavtool-pl-0.20150501/src/wavtool-pl.c:98:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp1,&(lenstr[indexofAt+1]),indexofPlus-indexofAt-1); data/wavtool-pl-0.20150501/src/wavtool-pl.c:103:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp1,&(lenstr[indexofPlus+1]),sizeof(tmp1)-1); data/wavtool-pl-0.20150501/src/wavtool-pl.c:133:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(argv[1]); data/wavtool-pl-0.20150501/src/wavtool-pl.c:136:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(wavtool_args.outputfilename, argv[1], len); data/wavtool-pl-0.20150501/src/wavtool-pl.c:139:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(argv[2]); data/wavtool-pl-0.20150501/src/wavtool-pl.c:142:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(wavtool_args.inputfilename, argv[2], len); data/wavtool-pl-0.20150501/src/wavtool-pl.c:194:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(wavtool_args.outputfilename)+4+1; data/wavtool-pl-0.20150501/src/wfd.c:249:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c1 = fgetc(outfile); data/wavtool-pl-0.20150501/src/wfd.c:254:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c2 = fgetc(outfile); data/wavtool-pl-0.20150501/src/wfh.c:40:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(file1); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 821 in approximately 0.03 seconds (25741 lines/second) Physical Source Lines of Code (SLOC) = 554 Hits@level = [0] 25 [1] 12 [2] 9 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 46 [1+] 21 [2+] 9 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 83.0325 [1+] 37.9061 [2+] 16.2455 [3+] 0 [4+] 0 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.