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/cavezofphear-0.5.1/src/loadmap.c Examining data/cavezofphear-0.5.1/src/common.h Examining data/cavezofphear-0.5.1/src/misc.c Examining data/cavezofphear-0.5.1/src/editor.c Examining data/cavezofphear-0.5.1/src/gplot.c Examining data/cavezofphear-0.5.1/src/chk.c Examining data/cavezofphear-0.5.1/src/frame.c Examining data/cavezofphear-0.5.1/src/proto.h Examining data/cavezofphear-0.5.1/src/isready.c Examining data/cavezofphear-0.5.1/src/splash.c Examining data/cavezofphear-0.5.1/src/main.c FINAL RESULTS: data/cavezofphear-0.5.1/src/main.c:51:15: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "e:vh")) != -1) { data/cavezofphear-0.5.1/src/main.c:82:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(0)); data/cavezofphear-0.5.1/src/chk.c:49: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 dir[64]; data/cavezofphear-0.5.1/src/chk.c:74: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 fname[128]; data/cavezofphear-0.5.1/src/chk.c:78:8: [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). fp = fopen(fname, "r"); data/cavezofphear-0.5.1/src/editor.c:27:1: [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 map[MAP_YSIZE][MAP_XSIZE]; data/cavezofphear-0.5.1/src/editor.c:62:8: [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). fp = fopen(file, "r"); data/cavezofphear-0.5.1/src/editor.c:212:8: [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). fp = fopen(filename, "w"); data/cavezofphear-0.5.1/src/gplot.c:30: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 fname[128]; data/cavezofphear-0.5.1/src/gplot.c:37:8: [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). fp = fopen(fname, "r"); data/cavezofphear-0.5.1/src/loadmap.c:23: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. int load_map(char *filename, char map[MAP_YSIZE][MAP_XSIZE]); data/cavezofphear-0.5.1/src/loadmap.c:23:30: [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. int load_map(char *filename, char map[MAP_YSIZE][MAP_XSIZE]); data/cavezofphear-0.5.1/src/loadmap.c:25: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. int load_map(char *filename, char map[MAP_YSIZE][MAP_XSIZE]) data/cavezofphear-0.5.1/src/loadmap.c:25:30: [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. int load_map(char *filename, char map[MAP_YSIZE][MAP_XSIZE]) data/cavezofphear-0.5.1/src/loadmap.c:31:8: [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). fp = fopen(filename, "r"); data/cavezofphear-0.5.1/src/main.c:31:1: [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 map[MAP_YSIZE][MAP_XSIZE]; data/cavezofphear-0.5.1/src/main.c:32:1: [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 special[MAP_YSIZE][MAP_XSIZE]; data/cavezofphear-0.5.1/src/main.c:33:1: [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 current_map[128]; data/cavezofphear-0.5.1/src/main.c:552: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 mstr[64]; data/cavezofphear-0.5.1/src/proto.h:53: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. int load_map(char *filename, char map[MAP_YSIZE][MAP_XSIZE]); data/cavezofphear-0.5.1/src/proto.h:53:30: [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. int load_map(char *filename, char map[MAP_YSIZE][MAP_XSIZE]); data/cavezofphear-0.5.1/src/editor.c:256:27: [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). mvprintw(0, calc_center(strlen("CAVEZ of PHEAR "VERSION" EDITOR")), "CAVEZ of PHEAR "VERSION" EDITOR"); data/cavezofphear-0.5.1/src/gplot.c:42:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = fgetc(fp)) != EOF) { data/cavezofphear-0.5.1/src/loadmap.c:41:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(fp); data/cavezofphear-0.5.1/src/main.c:823:27: [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). mvprintw(0, calc_center(strlen("CAVEZ of PHEAR ("VERSION")")), "CAVEZ of PHEAR ("VERSION")"); data/cavezofphear-0.5.1/src/misc.c:34: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). int len = strlen(message); data/cavezofphear-0.5.1/src/splash.c:38:27: [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). mvprintw(4, MAP_XSIZE - strlen(VERSION), "%s", VERSION); ANALYSIS SUMMARY: Hits = 27 Lines analyzed = 1987 in approximately 0.06 seconds (35073 lines/second) Physical Source Lines of Code (SLOC) = 1362 Hits@level = [0] 11 [1] 6 [2] 19 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 38 [1+] 27 [2+] 21 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 27.9001 [1+] 19.8238 [2+] 15.4185 [3+] 1.46843 [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.