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/libverilog-perl-3.474/Preproc/VFileLine.cpp Examining data/libverilog-perl-3.474/Preproc/VPreProc.cpp Examining data/libverilog-perl-3.474/Preproc/VPreLex.h Examining data/libverilog-perl-3.474/Preproc/VPreProc.h Examining data/libverilog-perl-3.474/Preproc/VFileLine.h Examining data/libverilog-perl-3.474/Parser/VParseGrammar.h Examining data/libverilog-perl-3.474/Parser/VSymTable.h Examining data/libverilog-perl-3.474/Parser/VParse.cpp Examining data/libverilog-perl-3.474/Parser/VAst.cpp Examining data/libverilog-perl-3.474/Parser/VParse.h Examining data/libverilog-perl-3.474/Parser/VSymTable.cpp Examining data/libverilog-perl-3.474/Parser/VParseLex.h Examining data/libverilog-perl-3.474/Parser/VAst.h FINAL RESULTS: data/libverilog-perl-3.474/Preproc/VPreProc.cpp:575:19: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if ((fp = popen(cmd.c_str(), "r")) == NULL) { data/libverilog-perl-3.474/Preproc/VFileLine.cpp:61:12: [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. static char buf[100]; data/libverilog-perl-3.474/Preproc/VFileLine.cpp:62:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"%d",i); data/libverilog-perl-3.474/Preproc/VFileLine.cpp:67:5: [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 numbuf[20]; sprintf(numbuf, "%d", lineno()); data/libverilog-perl-3.474/Preproc/VFileLine.cpp:67:22: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. char numbuf[20]; sprintf(numbuf, "%d", lineno()); data/libverilog-perl-3.474/Preproc/VFileLine.cpp:68:5: [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 levelbuf[20]; sprintf(levelbuf, "%d", enterExit); data/libverilog-perl-3.474/Preproc/VFileLine.cpp:68:24: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. char levelbuf[20]; sprintf(levelbuf, "%d", enterExit); data/libverilog-perl-3.474/Preproc/VFileLine.cpp:84:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). lineno = atoi(ln); data/libverilog-perl-3.474/Preproc/VFileLine.cpp:100:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (isdigit(*textp)) enterExitRef = atoi(textp); data/libverilog-perl-3.474/Preproc/VPreProc.cpp:567:5: [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 buf[INFILTER_IPC_BUFSIZ]; data/libverilog-perl-3.474/Preproc/VPreProc.cpp:580:14: [2] (misc) open: 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). fd = open(filename.c_str(), O_RDONLY); data/libverilog-perl-3.474/Parser/VParse.cpp:138:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf+got, front.c_str(), len); data/libverilog-perl-3.474/Preproc/VPreProc.cpp:586:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t got = read(fd, buf, todo); ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 3281 in approximately 0.35 seconds (9247 lines/second) Physical Source Lines of Code (SLOC) = 2262 Hits@level = [0] 10 [1] 2 [2] 10 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 23 [1+] 13 [2+] 11 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 10.168 [1+] 5.74713 [2+] 4.86295 [3+] 0.442087 [4+] 0.442087 [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.