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/xd-3.29.00/alternatives/separateat.cc Examining data/xd-3.29.00/alternatives/data.cc Examining data/xd-3.29.00/alternatives/globpattern.cc Examining data/xd-3.29.00/alternatives/gethome.cc Examining data/xd-3.29.00/alternatives/getcwd.cc Examining data/xd-3.29.00/alternatives/globfilter.cc Examining data/xd-3.29.00/alternatives/alternatives1.cc Examining data/xd-3.29.00/alternatives/set2.cc Examining data/xd-3.29.00/alternatives/matchignore.cc Examining data/xd-3.29.00/alternatives/alternatives.h Examining data/xd-3.29.00/alternatives/globhead.cc Examining data/xd-3.29.00/alternatives/configfile.cc Examining data/xd-3.29.00/alternatives/order.cc Examining data/xd-3.29.00/alternatives/checkcase.cc Examining data/xd-3.29.00/alternatives/viable.cc Examining data/xd-3.29.00/alternatives/glob.cc Examining data/xd-3.29.00/alternatives/globfrom.cc Examining data/xd-3.29.00/alternatives/determineinitialdir.cc Examining data/xd-3.29.00/alternatives/generalizedglob.cc Examining data/xd-3.29.00/alternatives/add.cc Examining data/xd-3.29.00/alternatives/addignored.cc Examining data/xd-3.29.00/arguments.cc Examining data/xd-3.29.00/command/data.cc Examining data/xd-3.29.00/command/command.h Examining data/xd-3.29.00/command/determineaction.cc Examining data/xd-3.29.00/command/concatargs.cc Examining data/xd-3.29.00/command/command1.cc Examining data/xd-3.29.00/documentation/kbd/writeKBbuffer.cc Examining data/xd-3.29.00/documentation/kbd/keytab.cc Examining data/xd-3.29.00/documentation/kbd/cdprog.cc Examining data/xd-3.29.00/filter/decided.cc Examining data/xd-3.29.00/filter/select.cc Examining data/xd-3.29.00/filter/showalternatives.cc Examining data/xd-3.29.00/filter/show.cc Examining data/xd-3.29.00/filter/setindex.cc Examining data/xd-3.29.00/filter/filter.h Examining data/xd-3.29.00/filter/filter1.cc Examining data/xd-3.29.00/history/infoopextract.cc Examining data/xd-3.29.00/history/data.cc Examining data/xd-3.29.00/history/history1.cc Examining data/xd-3.29.00/history/comparetimes.cc Examining data/xd-3.29.00/history/setdata.cc Examining data/xd-3.29.00/history/save.cc Examining data/xd-3.29.00/history/history.h Examining data/xd-3.29.00/history/comparecounts.cc Examining data/xd-3.29.00/history/maybeinsert.cc Examining data/xd-3.29.00/history/load.cc Examining data/xd-3.29.00/main.cc Examining data/xd-3.29.00/usage.cc Examining data/xd-3.29.00/version.cc Examining data/xd-3.29.00/VERSION.h FINAL RESULTS: data/xd-3.29.00/alternatives/getcwd.cc:5:21: [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. if (char *res = realpath(".", 0)) data/xd-3.29.00/alternatives/gethome.cc:7:16: [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 *cp = getenv("HOME"); // determine the homedir data/xd-3.29.00/alternatives/configfile.cc:9: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). arg.open(confName); data/xd-3.29.00/alternatives/configfile.cc:19:21: [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). arg.open(confName); data/xd-3.29.00/documentation/kbd/cdprog.cc:191: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("/dev/input/event0", O_WRONLY); data/xd-3.29.00/documentation/kbd/writeKBbuffer.cc:39:11: [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( (fd = open(device, O_RDWR)) > 0 ) data/xd-3.29.00/arguments.cc:37:18: [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 idx = strlen(last) - 1; // cmd line argument ANALYSIS SUMMARY: Hits = 7 Lines analyzed = 1848 in approximately 0.05 seconds (34646 lines/second) Physical Source Lines of Code (SLOC) = 1414 Hits@level = [0] 2 [1] 1 [2] 4 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 9 [1+] 7 [2+] 6 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 6.36492 [1+] 4.9505 [2+] 4.24328 [3+] 1.41443 [4+] 0 [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.