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/inoticoming-0.2.3/inoticoming.c Examining data/inoticoming-0.2.3/closeallfds.h Examining data/inoticoming-0.2.3/closeallfds.c FINAL RESULTS: data/inoticoming-0.2.3/inoticoming.c:58:66: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static void dolog(const char *format, ...) __attribute__((format(printf, 1, 2))); data/inoticoming-0.2.3/inoticoming.c:59:69: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static void logerror(const char *format, ...) __attribute__((format(printf, 1, 2))); data/inoticoming-0.2.3/inoticoming.c:60:73: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static void logerror_die(const char *format, ...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); data/inoticoming-0.2.3/inoticoming.c:67:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(logfile, format, ap); data/inoticoming-0.2.3/inoticoming.c:71:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stdout, format, ap); data/inoticoming-0.2.3/inoticoming.c:81:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(logfile, format, ap); data/inoticoming-0.2.3/inoticoming.c:88:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/inoticoming-0.2.3/inoticoming.c:98:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(logfile, format, ap); data/inoticoming-0.2.3/inoticoming.c:105:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/inoticoming-0.2.3/inoticoming.c:304:2: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(args[0], args); data/inoticoming-0.2.3/inoticoming.c:472:16: [3] (buffer) getopt_long: 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 ((opt = getopt_long(argc, argv, "+p:s:r:c:", long_options, NULL)) data/inoticoming-0.2.3/inoticoming.c:596:16: [3] (buffer) getopt_long: 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 ((opt = getopt_long(argc, argv, "+h?p:l:Ffi", data/inoticoming-0.2.3/inoticoming.c:193: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(event, buffer, size); data/inoticoming-0.2.3/inoticoming.c:223: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(r, value, subst); data/inoticoming-0.2.3/inoticoming.c:224: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(r+subst, filename, fnl); data/inoticoming-0.2.3/inoticoming.c:225: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(r+subst+fnl, value+subst, 1+len-subst); data/inoticoming-0.2.3/inoticoming.c:430: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(a->argument, v, len+1); data/inoticoming-0.2.3/inoticoming.c:679:13: [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). pidfile = fopen(pidfilename, "w"); data/inoticoming-0.2.3/inoticoming.c:690:14: [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). logfile = fopen(logfilename, "a"); data/inoticoming-0.2.3/inoticoming.c:167:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytesread = read(notifd, buffer+already, bufcount-already); data/inoticoming-0.2.3/inoticoming.c:217:15: [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). size_t fnl = strlen(filename); data/inoticoming-0.2.3/inoticoming.c:308:15: [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). size_t len = strlen(filename); data/inoticoming-0.2.3/inoticoming.c:495:26: [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). lookfor->prefixlen = strlen(lookfor->prefix); data/inoticoming-0.2.3/inoticoming.c:502:26: [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). lookfor->suffixlen = strlen(lookfor->suffix); ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 800 in approximately 0.04 seconds (20420 lines/second) Physical Source Lines of Code (SLOC) = 709 Hits@level = [0] 6 [1] 5 [2] 7 [3] 2 [4] 10 [5] 0 Hits@level+ = [0+] 30 [1+] 24 [2+] 19 [3+] 12 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 42.3131 [1+] 33.8505 [2+] 26.7983 [3+] 16.9252 [4+] 14.1044 [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.