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/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/test-assert-depth-colmajor.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples-blitz.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples-interactive.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples-framework.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-data-2d.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-data-1d.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/test-assert-depth.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/test-outputs.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-misc.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/test-noncopyable.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-interactive.cc Examining data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/gnuplot-iostream.h FINAL RESULTS: data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/gnuplot-iostream.h:124:25: [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. # define GNUPLOT_POPEN popen data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/gnuplot-iostream.h:1537:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *from_env = std::getenv("GNUPLOT_IOSTREAM_CMD"); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-misc.cc:219:18: [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). Gnuplot gp(std::fopen("inline_text.gnu", "w")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-misc.cc:232:18: [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). Gnuplot gp(std::fopen("inline_binary.gnu", "wb")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-misc.cc:245:18: [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). Gnuplot gp(std::fopen("external_text.gnu", "w")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-misc.cc:258:18: [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). Gnuplot gp(std::fopen("external_binary.gnu", "w")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/gnuplot-iostream.h:314: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 pty_fn_buf[1024]; data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/gnuplot-iostream.h:1552:20: [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). FILE *fh = std::fopen(fn.c_str(), "w"); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples.cc:246: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). Gnuplot gp(fopen("inline_text.gnu", "w")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples.cc:257: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). Gnuplot gp(fopen("inline_binary.gnu", "wb")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples.cc:268: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). Gnuplot gp(fopen("external_text.gnu", "w")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples.cc:279: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). Gnuplot gp(fopen("external_binary.gnu", "w")); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/example-misc.cc:49:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. ::usleep(millis * 1000); data/gnuplot-iostream-0~20140302.gitc8919a0+dfsg/legacy/examples.cc:41:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. ::usleep(millis * 1000); ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 4492 in approximately 0.19 seconds (23535 lines/second) Physical Source Lines of Code (SLOC) = 2926 Hits@level = [0] 15 [1] 2 [2] 10 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 29 [1+] 14 [2+] 12 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 9.91114 [1+] 4.78469 [2+] 4.10116 [3+] 0.683527 [4+] 0.341763 [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.