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/xft-2.3.2/include/X11/Xft/Xft.h Examining data/xft-2.3.2/include/X11/Xft/XftCompat.h Examining data/xft-2.3.2/src/xftstr.c Examining data/xft-2.3.2/src/xftfont.c Examining data/xft-2.3.2/src/xftglyphs.c Examining data/xft-2.3.2/src/xftcore.c Examining data/xft-2.3.2/src/xftlist.c Examining data/xft-2.3.2/src/xftdraw.c Examining data/xft-2.3.2/src/xftcolor.c Examining data/xft-2.3.2/src/xftxlfd.c Examining data/xft-2.3.2/src/xftswap.c Examining data/xft-2.3.2/src/xftfreetype.c Examining data/xft-2.3.2/src/xftinit.c Examining data/xft-2.3.2/src/xftrender.c Examining data/xft-2.3.2/src/xftextent.c Examining data/xft-2.3.2/src/xftdbg.c Examining data/xft-2.3.2/src/xftdpy.c Examining data/xft-2.3.2/src/xftname.c Examining data/xft-2.3.2/src/xftint.h FINAL RESULTS: data/xft-2.3.2/src/xftfreetype.c:71: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 (f->file, (char *) file); data/xft-2.3.2/src/xftname.c:79: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 (dest, ((char *) name)); data/xft-2.3.2/src/xftdbg.c:36:13: [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. e = getenv ("XFT_DEBUG"); data/xft-2.3.2/src/xftdbg.c:40:14: [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). debug = atoi (e); data/xft-2.3.2/src/xftdraw.c:611:6: [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 (glyphs_new, glyphs, size * sizeof (FT_UInt)); data/xft-2.3.2/src/xftdraw.c:656:6: [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 (glyphs_new, glyphs, size * sizeof (FT_UInt)); data/xft-2.3.2/src/xftdraw.c:934:5: [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 (XftClipRects (new), rects, n * sizeof (XRectangle)); data/xft-2.3.2/src/xftextent.c:228:6: [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 (glyphs_new, glyphs, size * sizeof (FT_UInt)); data/xft-2.3.2/src/xftextent.c:272:6: [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 (glyphs_new, glyphs, size * sizeof (FT_UInt)); data/xft-2.3.2/src/xftglyphs.c:217:7: [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( dstLine, srcLine, bytes ); data/xft-2.3.2/src/xftglyphs.c:243:7: [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( dstLine, srcLine, width ); data/xft-2.3.2/src/xftglyphs.c:356:14: [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 bufLocal[4096]; data/xft-2.3.2/src/xftglyphs.c:704:7: [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 (xftg->bitmap, bufBitmap, size); data/xft-2.3.2/src/xftrender.c:943:6: [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 (glyphs_new, glyphs, size * sizeof (FT_UInt)); data/xft-2.3.2/src/xftrender.c:993:6: [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 (glyphs_new, glyphs, size * sizeof (FT_UInt)); data/xft-2.3.2/src/xftswap.c:37:10: [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. n = ((char *) (x))[0];\ data/xft-2.3.2/src/xftswap.c:38:6: [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 *) (x))[0] = ((char *) (x))[3];\ data/xft-2.3.2/src/xftswap.c:38:26: [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 *) (x))[0] = ((char *) (x))[3];\ data/xft-2.3.2/src/xftswap.c:39:6: [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 *) (x))[3] = n;\ data/xft-2.3.2/src/xftswap.c:40:10: [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. n = ((char *) (x))[1];\ data/xft-2.3.2/src/xftswap.c:41:6: [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 *) (x))[1] = ((char *) (x))[2];\ data/xft-2.3.2/src/xftswap.c:41:26: [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 *) (x))[1] = ((char *) (x))[2];\ data/xft-2.3.2/src/xftswap.c:42:6: [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 *) (x))[2] = n; } data/xft-2.3.2/src/xftswap.c:46:10: [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. n = ((char *) (x))[0];\ data/xft-2.3.2/src/xftswap.c:47:6: [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 *) (x))[0] = ((char *) (x))[1];\ data/xft-2.3.2/src/xftswap.c:47:26: [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 *) (x))[0] = ((char *) (x))[1];\ data/xft-2.3.2/src/xftswap.c:48:6: [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 *) (x))[1] = n; } data/xft-2.3.2/src/xftswap.c:52:10: [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. n = ((char *) (x))[0];\ data/xft-2.3.2/src/xftswap.c:53:6: [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 *) (x))[0] = ((char *) (x))[2];\ data/xft-2.3.2/src/xftswap.c:53:26: [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 *) (x))[0] = ((char *) (x))[2];\ data/xft-2.3.2/src/xftswap.c:54:6: [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 *) (x))[2] = n; } data/xft-2.3.2/src/xftfreetype.c:57:38: [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). f = malloc (sizeof (XftFtFile) + strlen ((char *) file) + 1); data/xft-2.3.2/src/xftfreetype.c:61:53: [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). XftMemAlloc (XFT_MEM_FILE, sizeof (XftFtFile) + strlen ((char *) file) + 1); data/xft-2.3.2/src/xftfreetype.c:279:35: [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). sizeof (XftFtFile) + (f->file ? strlen (f->file) + 1 : 0)); data/xft-2.3.2/src/xftname.c:61:9: [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). if (strlen ((char *) name) + 1 > len) data/xft-2.3.2/src/xftname.c:71:6: [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). if (strlen ((char *) name) + 1 > len) data/xft-2.3.2/src/xftname.c:73:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (dest, ((char *) name), (size_t) len - 1); data/xft-2.3.2/src/xftxlfd.c:127:29: [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). save = (char *) malloc (strlen (foundry) + 1); ANALYSIS SUMMARY: Hits = 38 Lines analyzed = 8513 in approximately 0.22 seconds (38565 lines/second) Physical Source Lines of Code (SLOC) = 6723 Hits@level = [0] 57 [1] 7 [2] 28 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 95 [1+] 38 [2+] 31 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 14.1306 [1+] 5.65224 [2+] 4.61104 [3+] 0.446229 [4+] 0.297486 [5+] 0 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.