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/iptotal-0.3.3/iptotal.c FINAL RESULTS: data/iptotal-0.3.3/iptotal.c:475:27: [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. while(-1 != (optchar=getopt(argc,argv,"a:Ab:c:Cd:Ff:hl:L:m:M:o:Pr:t:v"))) data/iptotal-0.3.3/iptotal.c:196:2: [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 iptst[50],*ipa; data/iptotal-0.3.3/iptotal.c:399:2: [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(iptst,"%d.%d.%d.%d", data/iptotal-0.3.3/iptotal.c:492:14: [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). debug_m = atoi(optarg); data/iptotal-0.3.3/iptotal.c:509:13: [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). mask_m = atoi(optarg); data/iptotal-0.3.3/iptotal.c:521:15: [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). rcycle_m = atoi(optarg); data/iptotal-0.3.3/iptotal.c:543:2: [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 ebuf[PCAP_ERRBUF_SIZE]; data/iptotal-0.3.3/iptotal.c:658:2: [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 buffer[512]; data/iptotal-0.3.3/iptotal.c:662:8: [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). fin = fopen (filename, "r"); data/iptotal-0.3.3/iptotal.c:674:13: [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). debug_m = atoi(val); data/iptotal-0.3.3/iptotal.c:689:14: [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). rcycle_m = atoi(val); data/iptotal-0.3.3/iptotal.c:696:12: [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). mask_m = atoi(val); data/iptotal-0.3.3/iptotal.c:754:14: [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). str = str + strlen(str) - 1; data/iptotal-0.3.3/iptotal.c:785:9: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. while (equal && *a) { data/iptotal-0.3.3/iptotal.c:792:6: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (equal) return 0; ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 820 in approximately 0.10 seconds (8540 lines/second) Physical Source Lines of Code (SLOC) = 533 Hits@level = [0] 71 [1] 3 [2] 11 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 86 [1+] 15 [2+] 12 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 161.351 [1+] 28.1426 [2+] 22.5141 [3+] 1.87617 [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.