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/yank-1.2.0/yank.c FINAL RESULTS: data/yank-1.2.0/yank.c:108:6: [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. n = snprintf(pat, len, fmt, s); data/yank-1.2.0/yank.c:178:3: [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(yankargv[0], yankargv); data/yank-1.2.0/yank.c:427: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, "ilvxd:g:")) != -1) data/yank-1.2.0/yank.c:217:17: [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 ((tty.rfd = open("/dev/tty", O_RDONLY)) == -1) data/yank-1.2.0/yank.c:219:17: [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 ((tty.wfd = open("/dev/tty", O_WRONLY)) == -1) data/yank-1.2.0/yank.c:320: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 buf[4]; data/yank-1.2.0/yank.c:79:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((n = read(0, in.v + in.nmemb, in.size - in.nmemb)) != 0) { data/yank-1.2.0/yank.c:105: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). len = strlen(s) + strlen(fmt) + 1; data/yank-1.2.0/yank.c:105:20: [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). len = strlen(s) + strlen(fmt) + 1; data/yank-1.2.0/yank.c:203:6: [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). n = strlen(s); data/yank-1.2.0/yank.c:324:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(tty.rfd, buf, sizeof(buf) - 1); data/yank-1.2.0/yank.c:332:31: [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). if (strncmp(keys[i].s, buf, strlen(keys[i].s)) == 0) ANALYSIS SUMMARY: Hits = 12 Lines analyzed = 477 in approximately 0.04 seconds (12604 lines/second) Physical Source Lines of Code (SLOC) = 405 Hits@level = [0] 1 [1] 6 [2] 3 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 13 [1+] 12 [2+] 6 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 32.0988 [1+] 29.6296 [2+] 14.8148 [3+] 7.40741 [4+] 4.93827 [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.