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/termbox-1.1.2+dfsg/src/demo/output.c Examining data/termbox-1.1.2+dfsg/src/demo/keyboard.c Examining data/termbox-1.1.2+dfsg/src/demo/paint.c Examining data/termbox-1.1.2+dfsg/src/termbox.c Examining data/termbox-1.1.2+dfsg/src/termbox.h Examining data/termbox-1.1.2+dfsg/src/utf8.c FINAL RESULTS: data/termbox-1.1.2+dfsg/src/demo/keyboard.c:359:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, sizeof(buf), fmt, vl); data/termbox-1.1.2+dfsg/src/demo/keyboard.c:525:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(inputmode_str, "%s | TB_INPUT_MOUSE", inputmode_str); data/termbox-1.1.2+dfsg/src/demo/keyboard.c:356: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 buf[4096]; data/termbox-1.1.2+dfsg/src/demo/keyboard.c:517: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 inputmode_str[64]; data/termbox-1.1.2+dfsg/src/demo/keyboard.c:520: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(inputmode_str, "TB_INPUT_ESC"); data/termbox-1.1.2+dfsg/src/demo/keyboard.c:522: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(inputmode_str, "TB_INPUT_ALT"); data/termbox-1.1.2+dfsg/src/demo/keyboard.c:603: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 buf[7]; data/termbox-1.1.2+dfsg/src/demo/paint.c:85:2: [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(tb_cell_buffer(), backbuf, sizeof(struct tb_cell)*bbw*bbh); data/termbox-1.1.2+dfsg/src/termbox.c:134:20: [2] (misc) open: 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). return tb_init_fd(open(name, O_RDWR)); data/termbox-1.1.2+dfsg/src/termbox.c:194: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, sizeof(struct tb_cell)); data/termbox-1.1.2+dfsg/src/termbox.c:275: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(dst, src, size); data/termbox-1.1.2+dfsg/src/termbox.c:375: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 buf[32]; data/termbox-1.1.2+dfsg/src/termbox.c:384: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 buf[32]; data/termbox-1.1.2+dfsg/src/termbox.c:453: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(cdst, csrc, sizeof(struct tb_cell) * minw); data/termbox-1.1.2+dfsg/src/termbox.c:552: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 buf[7]; data/termbox-1.1.2+dfsg/src/utf8.c:3:23: [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 unsigned char utf8_length[256] = { data/termbox-1.1.2+dfsg/src/utf8.c:14:23: [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 unsigned char utf8_mask[6] = { data/termbox-1.1.2+dfsg/src/demo/output.c:52:31: [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). print_combinations_table(2 + strlen(chars), 1, col2, 1); data/termbox-1.1.2+dfsg/src/termbox.c:603:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(inout, input_buffer.buf + prevlen + read_n, n - read_n); data/termbox-1.1.2+dfsg/src/termbox.c:672:4: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(winch_fds[0], &zzz, sizeof(int)); ANALYSIS SUMMARY: Hits = 20 Lines analyzed = 2087 in approximately 0.09 seconds (22646 lines/second) Physical Source Lines of Code (SLOC) = 1717 Hits@level = [0] 4 [1] 3 [2] 15 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 24 [1+] 20 [2+] 17 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 13.9779 [1+] 11.6482 [2+] 9.90099 [3+] 1.16482 [4+] 1.16482 [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.