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/xcb-2.4/cb.h Examining data/xcb-2.4/patchlevel.h Examining data/xcb-2.4/xcb.c FINAL RESULTS: data/xcb-2.4/xcb.c:192: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 weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE]; data/xcb-2.4/xcb.c:365: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 tmp[32]; data/xcb-2.4/xcb.c:376:7: [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 (tmp, "CUT_BUFFER%d", n); data/xcb-2.4/xcb.c:626:9: [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). n = atoi (parms[0]); data/xcb-2.4/xcb.c:915:3: [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 (str, ptr, nb); data/xcb-2.4/xcb.c:1046:11: [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). n = atoi (arg); data/xcb-2.4/xcb.c:1131: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 name[16]; data/xcb-2.4/xcb.c:1244:7: [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 (name, "buffer%d", i); data/xcb-2.4/xcb.c:1275:7: [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 (name, "frame%d", i); data/xcb-2.4/xcb.c:1279:7: [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 (name, "buffer%d", i); data/xcb-2.4/xcb.c:127:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, p + 1, bufsiz - 2); data/xcb-2.4/xcb.c:136:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy (buf, "*", bufsiz); data/xcb-2.4/xcb.c:229:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (weight, "medium", FONT_ELEMENT_SIZE); data/xcb-2.4/xcb.c:231:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy (slant, "r", FONT_ELEMENT_SIZE); data/xcb-2.4/xcb.c:238:12: [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). bufsiz = strlen (pattern) + FONT_ELEMENT_SIZE * 2 + 2 * 2 + 58; data/xcb-2.4/xcb.c:326:13: [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). *nb = strlen (data); data/xcb-2.4/xcb.c:1062:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read (0, ptr + nb, i); ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 1407 in approximately 0.05 seconds (26936 lines/second) Physical Source Lines of Code (SLOC) = 1035 Hits@level = [0] 6 [1] 7 [2] 10 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 23 [1+] 17 [2+] 10 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 22.2222 [1+] 16.4251 [2+] 9.66184 [3+] 0 [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.