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/drawtiming-0.7.1/src/timing.h Examining data/drawtiming-0.7.1/src/globals.h Examining data/drawtiming-0.7.1/src/scanner.cc Examining data/drawtiming-0.7.1/src/parser.h Examining data/drawtiming-0.7.1/src/parser.cc Examining data/drawtiming-0.7.1/src/main.cc Examining data/drawtiming-0.7.1/src/timing.cc FINAL RESULTS: data/drawtiming-0.7.1/src/parser.cc:607:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define YYFPRINTF fprintf data/drawtiming-0.7.1/src/main.cc:28:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt_long(C,V,S,O,I) getopt(C,V,S) data/drawtiming-0.7.1/src/main.cc:28:34: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt_long(C,V,S,O,I) getopt(C,V,S) data/drawtiming-0.7.1/src/main.cc:104:15: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long (argc, argv, "ac:f:hl:o:p:vVw:x:", opts, &k)) != -1) data/drawtiming-0.7.1/src/main.cc:112:25: [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). timing::vCellHt = atoi (optarg); data/drawtiming-0.7.1/src/main.cc:119:32: [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). timing::vFontPointsize = atoi (optarg); data/drawtiming-0.7.1/src/main.cc:128:28: [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). timing::vLineWidth = atoi (optarg); data/drawtiming-0.7.1/src/main.cc:156:24: [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). timing::vCellW = atoi (optarg); data/drawtiming-0.7.1/src/main.cc:186:14: [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). yyin = fopen (argv[i], "rt"); data/drawtiming-0.7.1/src/parser.cc:904:7: [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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/drawtiming-0.7.1/src/parser.cc:921:7: [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 yyformat[sizeof yyunexpected data/drawtiming-0.7.1/src/parser.cc:1089: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 yymsgbuf[128]; data/drawtiming-0.7.1/src/timing.cc:941:7: [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). out.open (filename.c_str()); data/drawtiming-0.7.1/src/parser.cc:785:21: [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). # define yystrlen strlen data/drawtiming-0.7.1/src/scanner.cc:536:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 4820 in approximately 0.12 seconds (39251 lines/second) Physical Source Lines of Code (SLOC) = 3291 Hits@level = [0] 6 [1] 2 [2] 9 [3] 3 [4] 1 [5] 0 Hits@level+ = [0+] 21 [1+] 15 [2+] 13 [3+] 4 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 6.38104 [1+] 4.55789 [2+] 3.95017 [3+] 1.21544 [4+] 0.303859 [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.