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/libsocket6-perl-0.29/getnameinfo.c Examining data/libsocket6-perl-0.29/getaddrinfo.c Examining data/libsocket6-perl-0.29/inet_pton.c Examining data/libsocket6-perl-0.29/gai.h Examining data/libsocket6-perl-0.29/inet_ntop.c FINAL RESULTS: data/libsocket6-perl-0.29/getnameinfo.c:42:6: [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(serv, tmpserv); data/libsocket6-perl-0.29/getnameinfo.c:51:3: [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(host, inet_ntoa(sin->sin_addr)); data/libsocket6-perl-0.29/getnameinfo.c:61:7: [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(host, hp->h_name); data/libsocket6-perl-0.29/getnameinfo.c:69:3: [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(host, inet_ntoa(sin->sin_addr)); data/libsocket6-perl-0.29/inet_ntop.c:85:21: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) data/libsocket6-perl-0.29/inet_ntop.c:90:9: [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(dst, tmp); data/libsocket6-perl-0.29/inet_ntop.c:187:9: [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(dst, tmp); data/libsocket6-perl-0.29/getaddrinfo.c:112:19: [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). port = htons(atoi(servname)); data/libsocket6-perl-0.29/getnameinfo.c:35:5: [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 tmpserv[16]; data/libsocket6-perl-0.29/inet_ntop.c:83:9: [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 tmp[sizeof "255.255.255.255"]; data/libsocket6-perl-0.29/inet_ntop.c:112:9: [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 tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; data/libsocket6-perl-0.29/inet_ntop.c:172:23: [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. tp += sprintf(tp, "%x", words[i]); data/libsocket6-perl-0.29/inet_pton.c:79:18: [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. unsigned char tmp[NS_INADDRSZ], *tp; data/libsocket6-perl-0.29/inet_pton.c:108:9: [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(dst, tmp, NS_INADDRSZ); data/libsocket6-perl-0.29/inet_pton.c:133:18: [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. unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; data/libsocket6-perl-0.29/inet_pton.c:207:9: [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(dst, tmp, NS_IN6ADDRSZ); data/libsocket6-perl-0.29/getnameinfo.c:39:6: [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). if (strlen(tmpserv) > servlen) data/libsocket6-perl-0.29/getnameinfo.c:48:10: [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). if (strlen(inet_ntoa(sin->sin_addr)) >= hostlen) data/libsocket6-perl-0.29/getnameinfo.c:58:7: [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). if (strlen(hp->h_name) >= hostlen) data/libsocket6-perl-0.29/getnameinfo.c:66:15: [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). else if (strlen(inet_ntoa(sin->sin_addr)) >= hostlen) data/libsocket6-perl-0.29/inet_ntop.c:169:31: [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). tp += strlen(tp); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 701 in approximately 0.06 seconds (10858 lines/second) Physical Source Lines of Code (SLOC) = 469 Hits@level = [0] 1 [1] 5 [2] 9 [3] 0 [4] 7 [5] 0 Hits@level+ = [0+] 22 [1+] 21 [2+] 16 [3+] 7 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 46.9083 [1+] 44.7761 [2+] 34.1151 [3+] 14.9254 [4+] 14.9254 [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.