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/libnatpmp-20150609/getgateway.c Examining data/libnatpmp-20150609/getgateway.h Examining data/libnatpmp-20150609/natpmp.c Examining data/libnatpmp-20150609/natpmp.h Examining data/libnatpmp-20150609/natpmpc.c Examining data/libnatpmp-20150609/testgetgateway.c Examining data/libnatpmp-20150609/wingettimeofday.c Examining data/libnatpmp-20150609/wingettimeofday.h Examining data/libnatpmp-20150609/declspec.h Examining data/libnatpmp-20150609/natpmp-jni.c Examining data/libnatpmp-20150609/libnatpmpmodule.c FINAL RESULTS: data/libnatpmp-20150609/getgateway.c:145: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 buf[256]; data/libnatpmp-20150609/getgateway.c:149:6: [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). f = fopen("/proc/net/route", "r"); data/libnatpmp-20150609/getgateway.c:247: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 m_space[512]; data/libnatpmp-20150609/getgateway.c:329:2: [2] (buffer) TCHAR: 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. TCHAR keyName[MAX_KEY_LENGTH]; data/libnatpmp-20150609/getgateway.c:331:2: [2] (buffer) TCHAR: 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. TCHAR keyValue[MAX_VALUE_LENGTH]; data/libnatpmp-20150609/getgateway.c:334:2: [2] (buffer) TCHAR: 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. TCHAR gatewayValue[MAX_VALUE_LENGTH]; data/libnatpmp-20150609/getgateway.c:485: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 tmp[32]; data/libnatpmp-20150609/natpmp.c:201:11: [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 buf[16]; data/libnatpmp-20150609/natpmp.h:62:11: [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 pending_request[12]; data/libnatpmp-20150609/getgateway.c:289:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 2079 in approximately 0.07 seconds (30024 lines/second) Physical Source Lines of Code (SLOC) = 1430 Hits@level = [0] 43 [1] 1 [2] 9 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 53 [1+] 10 [2+] 9 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 37.0629 [1+] 6.99301 [2+] 6.29371 [3+] 0 [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.