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/netselect-0.3.ds1/netinet/udp.h Examining data/netselect-0.3.ds1/netinet/ip_icmp.h Examining data/netselect-0.3.ds1/netinet/ip.h Examining data/netselect-0.3.ds1/csum.c Examining data/netselect-0.3.ds1/netselect.c FINAL RESULTS: data/netselect-0.3.ds1/netselect.c:558:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(newbuf+(sptr-orig), hostname); data/netselect-0.3.ds1/netselect.c:559:2: [4] (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). strcat(newbuf, eptr); data/netselect-0.3.ds1/netselect.c:566:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(newbuf, hostname); data/netselect-0.3.ds1/netselect.c:567:2: [4] (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). strcat(newbuf, sptr); data/netselect-0.3.ds1/netselect.c:209:18: [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 ((ch = getopt(argc, argv, "s:t:m:IDv?")) != EOF) data/netselect-0.3.ds1/netinet/ip_icmp.h:81: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 id_data[1]; data/netselect-0.3.ds1/netselect.c:214:18: [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). num_score = atoi(optarg); data/netselect-0.3.ds1/netselect.c:218:18: [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). min_tries = atoi(optarg); data/netselect-0.3.ds1/netselect.c:227:16: [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). max_ttl = atoi(optarg); data/netselect-0.3.ds1/netselect.c:505:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&host->addr, addr, sizeof(*addr)); data/netselect-0.3.ds1/netselect.c:664:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&result.addr.sin_addr, data/netselect-0.3.ds1/netselect.c:527:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newbuf, sptr, eptr-sptr); data/netselect-0.3.ds1/netselect.c:535:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newbuf, orig, sptr-orig); data/netselect-0.3.ds1/netselect.c:556:26: [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). newbuf = (char *)malloc(strlen(orig) + strlen(hostname) + 1); data/netselect-0.3.ds1/netselect.c:556:41: [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). newbuf = (char *)malloc(strlen(orig) + strlen(hostname) + 1); data/netselect-0.3.ds1/netselect.c:557:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newbuf, orig, sptr-orig); data/netselect-0.3.ds1/netselect.c:565:26: [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). newbuf = (char *)malloc(strlen(orig) + strlen(hostname) + 1); data/netselect-0.3.ds1/netselect.c:565:41: [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). newbuf = (char *)malloc(strlen(orig) + strlen(hostname) + 1); data/netselect-0.3.ds1/netselect.c:718:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pipes[0], &result, sizeof(result)) != sizeof(result)) ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 1556 in approximately 0.05 seconds (30152 lines/second) Physical Source Lines of Code (SLOC) = 1082 Hits@level = [0] 35 [1] 8 [2] 6 [3] 1 [4] 4 [5] 0 Hits@level+ = [0+] 54 [1+] 19 [2+] 11 [3+] 5 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 49.9076 [1+] 17.5601 [2+] 10.1664 [3+] 4.62107 [4+] 3.69686 [5+] 0 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.