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/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c Examining data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c Examining data/wordgrinder-0.8/src/c/arch/unix/x11/x11.h Examining data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c Examining data/wordgrinder-0.8/src/c/arch/win32/gdi/gdi.h Examining data/wordgrinder-0.8/src/c/arch/win32/gdi/glyphcache.c Examining data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c Examining data/wordgrinder-0.8/src/c/arch/win32/gdi/realmain.c Examining data/wordgrinder-0.8/src/c/arch/win32/console/dpy.c Examining data/wordgrinder-0.8/src/c/arch/win32/console/realmain.c Examining data/wordgrinder-0.8/src/c/zip.c Examining data/wordgrinder-0.8/src/c/filesystem.c Examining data/wordgrinder-0.8/src/c/globals.h Examining data/wordgrinder-0.8/src/c/lua.c Examining data/wordgrinder-0.8/src/c/main.c Examining data/wordgrinder-0.8/src/c/screen.c Examining data/wordgrinder-0.8/src/c/utils.c Examining data/wordgrinder-0.8/src/c/word.c FINAL RESULTS: data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:240:3: [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(buf, name); data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:252:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%s", ss, ps); data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:258:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_UNKNOWN_%d (%s)", k, name ? name : "???"); data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:66:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%s%s", normalfont, bold); data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:70:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%s%s", normalfont, italic); data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:74:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%s%s%s", normalfont, bold, italic); data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c:412:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s^%c", data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c:450:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%s%s", data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c:459:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%sF%d", data/wordgrinder-0.8/src/c/arch/win32/console/dpy.c:299:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s^%c", data/wordgrinder-0.8/src/c/arch/win32/console/dpy.c:328:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%s%s", data/wordgrinder-0.8/src/c/arch/win32/console/dpy.c:337:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%sF%d", data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:907:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s^%c", data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:936:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%s%s", data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:945:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "KEY_%s%sF%d", data/wordgrinder-0.8/src/c/filesystem.c:149:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(filename, mode) != 0) data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:99:2: [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 buffer[8]; data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:223:9: [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 buffer[32]; data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:226:3: [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(buffer, "KEY_^%c", k+'A'-1); data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:232:3: [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(buffer, "KEY_F%d", k - KEY_F0); data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:239: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 buf[strlen(name)+1]; data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:61:2: [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 buffer[strlen(normalfont) + strlen(bold) + strlen(italic)]; data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c:350:5: [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 buffer[32]; data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c:398:9: [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 buffer[32]; data/wordgrinder-0.8/src/c/arch/unix/x11/x11.c:466:2: [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(buffer, "KEY_UNKNOWN_%d", -k); data/wordgrinder-0.8/src/c/arch/win32/console/dpy.c:295:9: [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 buffer[32]; data/wordgrinder-0.8/src/c/arch/win32/console/dpy.c:344:2: [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(buffer, "KEY_UNKNOWN_%d", -k); data/wordgrinder-0.8/src/c/arch/win32/console/realmain.c:16:2: [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 path[MAX_PATH] = "WINDOWS_EXE="; data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:847:4: [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(front, back, screenwidth * sizeof(*backbuffer)); data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:903:9: [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 buffer[32]; data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:952:2: [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(buffer, "KEY_UNKNOWN_%d", -k); data/wordgrinder-0.8/src/c/arch/win32/gdi/glyphcache.c:108: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 buffer[result]; data/wordgrinder-0.8/src/c/arch/win32/gdi/realmain.c:74:2: [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 path[MAX_PATH] = "WINDOWS_EXE="; data/wordgrinder-0.8/src/c/screen.c:222:11: [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 buffer[8]; data/wordgrinder-0.8/src/c/utils.c:13:21: [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 const signed char trailing_bytes[256] = { data/wordgrinder-0.8/src/c/utils.c:132:9: [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 buffer[8]; data/wordgrinder-0.8/src/c/word.c:153:2: [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 dest[bytes+1]; data/wordgrinder-0.8/src/c/word.c:299:2: [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 dest[srcbytes + insbytes + OVERHEAD]; data/wordgrinder-0.8/src/c/word.c:353:2: [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 dest[srcbytes]; data/wordgrinder-0.8/src/c/word.c:394:2: [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 dest[srcbytes+2]; data/wordgrinder-0.8/src/c/arch/unix/cursesw/dpy.c:239: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). char buf[strlen(name)+1]; data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:61:14: [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). char buffer[strlen(normalfont) + strlen(bold) + strlen(italic)]; data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:61: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). char buffer[strlen(normalfont) + strlen(bold) + strlen(italic)]; data/wordgrinder-0.8/src/c/arch/unix/x11/glyphcache.c:61:50: [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). char buffer[strlen(normalfont) + strlen(bold) + strlen(italic)]; data/wordgrinder-0.8/src/c/arch/win32/console/realmain.c:17: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). const int len = strlen(path); data/wordgrinder-0.8/src/c/arch/win32/gdi/dpy.c:693: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). mii.cch = strlen(msg); data/wordgrinder-0.8/src/c/arch/win32/gdi/realmain.c:75: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). const int len = strlen(path); ANALYSIS SUMMARY: Hits = 47 Lines analyzed = 4975 in approximately 0.12 seconds (41609 lines/second) Physical Source Lines of Code (SLOC) = 3880 Hits@level = [0] 6 [1] 7 [2] 24 [3] 0 [4] 16 [5] 0 Hits@level+ = [0+] 53 [1+] 47 [2+] 40 [3+] 16 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 13.6598 [1+] 12.1134 [2+] 10.3093 [3+] 4.12371 [4+] 4.12371 [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.