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/icmptx-0.2/icmptx.c Examining data/icmptx-0.2/it.c Examining data/icmptx-0.2/tun_dev.c Examining data/icmptx-0.2/tun_dev.h FINAL RESULTS: data/icmptx-0.2/icmptx.c:38:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, USAGE, argv[0]); data/icmptx-0.2/icmptx.c:42:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, USAGE, argv[0]); data/icmptx-0.2/tun_dev.c:41:5: [4] (format) snprintf: 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. int snprintf(char *str, size_t size, const char *format, ...); data/icmptx-0.2/it.c:135:7: [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(&(target->sin_addr.s_addr), &(from.sin_addr.s_addr), 4*sizeof(char)); data/icmptx-0.2/it.c:192: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 (&target.sin_addr.s_addr, he->h_addr_list[0], he->h_length); data/icmptx-0.2/tun_dev.c:47: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 tunname[14]; data/icmptx-0.2/tun_dev.c:51:5: [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(tunname, "/dev/tun%d", i); data/icmptx-0.2/tun_dev.c:53:13: [2] (misc) open: 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). if( (fd=open(tunname, O_RDWR)) > 0 ){ data/icmptx-0.2/tun_dev.c:72:13: [2] (misc) open: 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). if ((fd = open("/dev/net/tun", O_RDWR)) < 0) { data/icmptx-0.2/tun_dev.c:105:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(fd, buf, len); ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 432 in approximately 0.02 seconds (19233 lines/second) Physical Source Lines of Code (SLOC) = 236 Hits@level = [0] 3 [1] 1 [2] 6 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 13 [1+] 10 [2+] 9 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 55.0847 [1+] 42.3729 [2+] 38.1356 [3+] 12.7119 [4+] 12.7119 [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.