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/xclip-0.13/xcdef.h Examining data/xclip-0.13/xclib.h Examining data/xclip-0.13/xclip.c Examining data/xclip-0.13/xcprint.h Examining data/xclip-0.13/xclib.c Examining data/xclip-0.13/xcprint.c FINAL RESULTS: data/xclip-0.13/xclib.c:73:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(mem, string); data/xclip-0.13/xcprint.c:123:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(msg_all, msg_cur); data/xclip-0.13/xcprint.c:87:12: [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. display = getenv("DISPLAY"); data/xclip-0.13/xclib.c:200: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(ltxt, buffer, pty_machsize); data/xclip-0.13/xclib.c:279: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(<xt[*len - pty_machsize], buffer, pty_machsize); data/xclip-0.13/xclip.c:130:10: [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). sloop = atoi(rec_val.addr); data/xclip-0.13/xclip.c:231:24: [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). if ((fil_handle = fopen(fil_names[fil_current], "r")) == NULL) { data/xclip-0.13/xclib.c:72: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). mem = xcmalloc(strlen(string) + sizeof(char)); data/xclip-0.13/xcprint.c:119:40: [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). msg_all = (char *) xcrealloc(msg_all, strlen(msg_all) + strlen(msg_cur) + sizeof(char) data/xclip-0.13/xcprint.c:119:58: [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). msg_all = (char *) xcrealloc(msg_all, strlen(msg_all) + strlen(msg_cur) + sizeof(char) ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 1372 in approximately 0.05 seconds (27110 lines/second) Physical Source Lines of Code (SLOC) = 799 Hits@level = [0] 30 [1] 3 [2] 4 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 40 [1+] 10 [2+] 7 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 50.0626 [1+] 12.5156 [2+] 8.76095 [3+] 3.75469 [4+] 2.50313 [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.