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/inputplug-0.3/inputplug.c FINAL RESULTS: data/inputplug-0.3/inputplug.c:124:17: [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(command, args); data/inputplug-0.3/inputplug.c:244:26: [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. const char * value = getenv(name); data/inputplug-0.3/inputplug.c:280:20: [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 (((opt = getopt(argc, argv, IXP_GETOPT "vhnd0c:" PIDFILE_GETOPT)) != -1) || data/inputplug-0.3/inputplug.c:299:27: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. command = realpath(optarg, NULL); data/inputplug-0.3/inputplug.c:145: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. char deviceid[strlen(UINT_MAX_STRING) + 1]; data/inputplug-0.3/inputplug.c:146:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(deviceid, "%d", id); data/inputplug-0.3/inputplug.c:145:23: [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). char deviceid[strlen(UINT_MAX_STRING) + 1]; data/inputplug-0.3/inputplug.c:208:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, xcb_input_xi_device_info_name(info), info->name_len); data/inputplug-0.3/inputplug.c:347:43: [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). qe_cookie = xcb_query_extension(conn, strlen(ext), ext); data/inputplug-0.3/inputplug.c:441:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, xcb_input_xi_device_info_name(info), info->name_len); ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 551 in approximately 0.04 seconds (12557 lines/second) Physical Source Lines of Code (SLOC) = 471 Hits@level = [0] 15 [1] 4 [2] 2 [3] 3 [4] 1 [5] 0 Hits@level+ = [0+] 25 [1+] 10 [2+] 6 [3+] 4 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 53.0786 [1+] 21.2314 [2+] 12.7389 [3+] 8.49257 [4+] 2.12314 [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.