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/capstats-0.29/capstats.cc FINAL RESULTS: data/capstats-0.29/capstats.cc:103:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. n += vsnprintf(buffer + n, SIZE - n, fmt, ap); data/capstats-0.29/capstats.cc:528:17: [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. int c = getopt_long (argc, argv, "df:i:I:n:Np:q:s:lvw:S:", long_options, 0); data/capstats-0.29/capstats.cc:530:17: [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. int c = getopt_long (argc, argv, "f:i:I:n:Np:q:s:lvw:S:", long_options, 0); data/capstats-0.29/capstats.cc:99: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 buffer[SIZE]; data/capstats-0.29/capstats.cc:153: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 errbuf[PCAP_ERRBUF_SIZE]; data/capstats-0.29/capstats.cc:354: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 buffer[SIZE]; data/capstats-0.29/capstats.cc:550: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). Interval = atoi(optarg); data/capstats-0.29/capstats.cc:558:26: [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). NumberInts = atoi(optarg); data/capstats-0.29/capstats.cc:567:23: [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). Payload = atoi(optarg); data/capstats-0.29/capstats.cc:571:21: [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). Quiet = atoi(optarg); data/capstats-0.29/capstats.cc:576:20: [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). Size = atoi(optarg); data/capstats-0.29/capstats.cc:580:23: [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). SnapLen = atoi(optarg); data/capstats-0.29/capstats.cc:105:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(buffer + n, "\n"); ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 649 in approximately 0.05 seconds (12206 lines/second) Physical Source Lines of Code (SLOC) = 498 Hits@level = [0] 11 [1] 1 [2] 9 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 24 [1+] 13 [2+] 12 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 48.1928 [1+] 26.1044 [2+] 24.0964 [3+] 6.0241 [4+] 2.00803 [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.