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/nocache-1.1/cachedel.c Examining data/nocache-1.1/cachestats.c Examining data/nocache-1.1/fcntl_helpers.c Examining data/nocache-1.1/fcntl_helpers.h Examining data/nocache-1.1/nocache.c Examining data/nocache-1.1/pageinfo.c Examining data/nocache-1.1/pageinfo.h FINAL RESULTS: data/nocache-1.1/nocache.c:81:13: [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(debugfp, "[nocache] DEBUG: " __VA_ARGS__); \ data/nocache-1.1/pageinfo.c:17:13: [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(debugfp, "[nocache] DEBUG: " __VA_ARGS__); \ data/nocache-1.1/nocache.c:120:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if((s = getenv(env_nr_fadvise)) != NULL) data/nocache-1.1/nocache.c:125:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if((s = getenv(env_flushall)) != NULL) data/nocache-1.1/nocache.c:157:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *s = getenv(env_debugfd); data/nocache-1.1/cachedel.c:23:17: [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). n = atoi(argv[2]); data/nocache-1.1/cachedel.c:33:10: [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). fd = open(fn, O_RDONLY); data/nocache-1.1/cachestats.c:49:10: [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). fd = open(argv[1], O_RDONLY); data/nocache-1.1/nocache.c:29:5: [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 open(const char *pathname, int flags, mode_t mode); data/nocache-1.1/nocache.c:40:7: [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). FILE *fopen(const char *path, const char *mode); data/nocache-1.1/nocache.c:121:22: [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). nr_fadvise = atoi(s); data/nocache-1.1/nocache.c:126:20: [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). flushall = atoi(s); data/nocache-1.1/nocache.c:160:15: [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). debugfd = atoi(s); data/nocache-1.1/nocache.c:206:5: [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 open(const char *pathname, int flags, mode_t mode) data/nocache-1.1/nocache.c:345:7: [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). FILE *fopen(const char *path, const char *mode) ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 862 in approximately 0.03 seconds (27943 lines/second) Physical Source Lines of Code (SLOC) = 679 Hits@level = [0] 14 [1] 0 [2] 10 [3] 3 [4] 2 [5] 0 Hits@level+ = [0+] 29 [1+] 15 [2+] 15 [3+] 5 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 42.7099 [1+] 22.0913 [2+] 22.0913 [3+] 7.36377 [4+] 2.94551 [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.