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/x2x-1.30/keymap.c Examining data/x2x-1.30/keymap.h Examining data/x2x-1.30/resource.h Examining data/x2x-1.30/winmsg.c Examining data/x2x-1.30/x2x.c FINAL RESULTS: data/x2x-1.30/x2x.c:397:22: [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. #define debug_cmpreg printf data/x2x-1.30/x2x.c:405:15: [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. #define debug printf data/x2x-1.30/x2x.c:1342:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(windowName, "%s %s", programStr, toDpyName); data/x2x-1.30/x2x.c:3082:15: [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(pDpyInfo->winSelText, lptstr); data/x2x-1.30/x2x.c:3671:11: [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(lptstrCopy, prop); data/x2x-1.30/keymap.c:123:17: [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. static unsigned char buf[4]; data/x2x-1.30/keymap.c:124:17: [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. static unsigned char keystate[256]; data/x2x-1.30/winmsg.c:214:8: [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. static char *msgstr[MAX_TEXT]; data/x2x-1.30/x2x.c:422:3: [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 *argv[MAX_WIN_ARGS]; data/x2x-1.30/x2x.c:683:23: [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). logicalOffset = atoi(argv[arg]); data/x2x-1.30/x2x.c:708:16: [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). button = atoi(argv[arg]); data/x2x-1.30/x2x.c:755:18: [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). triggerw = atoi(argv[arg]); data/x2x-1.30/x2x.c:762:21: [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). compRegLeft = atoi(argv[arg]); data/x2x-1.30/x2x.c:765:22: [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). compRegRight = atoi(argv[arg]); data/x2x-1.30/x2x.c:768:19: [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). compRegUp = atoi(argv[arg]); data/x2x-1.30/x2x.c:771:20: [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). compRegLow = atoi(argv[arg]); data/x2x-1.30/x2x.c:2635:12: [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. unsigned char buttonMap[N_BUTTONS]; data/x2x-1.30/x2x.c:3374:3: [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 keyname[32]; data/x2x-1.30/x2x.c:1278:46: [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). XQueryTextExtents(fromDpy, fid, label, strlen(label), data/x2x-1.30/x2x.c:1341:34: [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). windowName = (char *)xmalloc(strlen(programStr) + strlen(toDpyName) + 2); data/x2x-1.30/x2x.c:1341:55: [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). windowName = (char *)xmalloc(strlen(programStr) + strlen(toDpyName) + 2); data/x2x-1.30/x2x.c:2011:32: [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). pDpyInfo->tascent, label, strlen(label)); data/x2x-1.30/x2x.c:3076:17: [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(lptstr); data/x2x-1.30/x2x.c:3603: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). pDpyInfo->winSelText, strlen(pDpyInfo->winSelText)); data/x2x-1.30/x2x.c:3666:33: [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). (strlen(prop) + 1) * sizeof(char)); data/x2x-1.30/x2x.c:3675:37: [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). pDpyInfo->expectOwnClip = strlen(prop) + 1; ANALYSIS SUMMARY: Hits = 26 Lines analyzed = 4281 in approximately 0.11 seconds (38770 lines/second) Physical Source Lines of Code (SLOC) = 3275 Hits@level = [0] 69 [1] 8 [2] 13 [3] 0 [4] 5 [5] 0 Hits@level+ = [0+] 95 [1+] 26 [2+] 18 [3+] 5 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 29.0076 [1+] 7.93893 [2+] 5.49618 [3+] 1.52672 [4+] 1.52672 [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.