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/mrc-1.2.3/dummy.cpp Examining data/mrc-1.2.3/mrc-unit-test.cpp Examining data/mrc-1.2.3/mrsrc.h Examining data/mrc-1.2.3/mrc.cpp FINAL RESULTS: data/mrc-1.2.3/mrc.cpp:786:11: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. int r = readlink("/proc/self/exe", exePath, PATH_MAX); data/mrc-1.2.3/mrc.cpp:784: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 exePath[PATH_MAX + 1]; data/mrc-1.2.3/mrc.cpp:791: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). int fd = open(exePath, O_RDONLY); data/mrc-1.2.3/mrc.cpp:794:14: [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 e_ident[16]; data/mrc-1.2.3/mrc.cpp:79:8: [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). p += strlen(p) + 1; data/mrc-1.2.3/mrc.cpp:796:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, e_ident, sizeof(e_ident)) == sizeof(e_ident) and data/mrc-1.2.3/mrc.cpp:811:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &hdr, sizeof(hdr)) == sizeof(Elf32_Ehdr)) data/mrc-1.2.3/mrc.cpp:822:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &hdr, sizeof(hdr)) == sizeof(Elf64_Ehdr)) ANALYSIS SUMMARY: Hits = 8 Lines analyzed = 1413 in approximately 0.06 seconds (23458 lines/second) Physical Source Lines of Code (SLOC) = 988 Hits@level = [0] 0 [1] 4 [2] 3 [3] 0 [4] 0 [5] 1 Hits@level+ = [0+] 8 [1+] 8 [2+] 4 [3+] 1 [4+] 1 [5+] 1 Hits/KSLOC@level+ = [0+] 8.09717 [1+] 8.09717 [2+] 4.04858 [3+] 1.01215 [4+] 1.01215 [5+] 1.01215 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.