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/farpd-0.2/acconfig.h Examining data/farpd-0.2/daemon.c Examining data/farpd-0.2/err.h Examining data/farpd-0.2/tree.h Examining data/farpd-0.2/arpd.c FINAL RESULTS: data/farpd-0.2/arpd.c:506:2: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(PIDFILE, 0644); data/farpd-0.2/arpd.c:471:14: [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 ((c = getopt(argc, argv, "di:h?")) != -1) { data/farpd-0.2/arpd.c:85: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. static char filter[1024]; data/farpd-0.2/arpd.c:86: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 line[1024], *p; data/farpd-0.2/arpd.c:138: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 single[32]; data/farpd-0.2/arpd.c:188: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 filter[1024], ebuf[PCAP_ERRBUF_SIZE], *dst; data/farpd-0.2/arpd.c:289: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(&arpent.arp_pa, addr, sizeof(*addr)); data/farpd-0.2/arpd.c:328:3: [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(&req->ha, ha, sizeof(*ha)); data/farpd-0.2/arpd.c:379:4: [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(&req->pa, &tmp.pa, sizeof(tmp.pa)); data/farpd-0.2/arpd.c:492:12: [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). if ((fp = fopen(PIDFILE, "w")) == NULL) data/farpd-0.2/daemon.c:58:27: [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 (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) { data/farpd-0.2/arpd.c:206:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arpd_ifent.intf_name, dev, sizeof(arpd_ifent.intf_name) - 1); ANALYSIS SUMMARY: Hits = 12 Lines analyzed = 1305 in approximately 0.06 seconds (21637 lines/second) Physical Source Lines of Code (SLOC) = 1009 Hits@level = [0] 19 [1] 1 [2] 9 [3] 1 [4] 0 [5] 1 Hits@level+ = [0+] 31 [1+] 12 [2+] 11 [3+] 2 [4+] 1 [5+] 1 Hits/KSLOC@level+ = [0+] 30.7235 [1+] 11.893 [2+] 10.9019 [3+] 1.98216 [4+] 0.99108 [5+] 0.99108 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.