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/libtickit-0.4.1/examples/demo-pen.c Examining data/libtickit-0.4.1/examples/demo-rgb8.c Examining data/libtickit-0.4.1/examples/demo-scroll.c Examining data/libtickit-0.4.1/examples/demo-termctl.c Examining data/libtickit-0.4.1/examples/demo-xterm256.c Examining data/libtickit-0.4.1/examples/demo.c Examining data/libtickit-0.4.1/examples/evloop-glib.c Examining data/libtickit-0.4.1/examples/evloop-libuv.c Examining data/libtickit-0.4.1/include/tickit-evloop.h Examining data/libtickit-0.4.1/include/tickit-mockterm.h Examining data/libtickit-0.4.1/include/tickit-termdrv.h Examining data/libtickit-0.4.1/include/tickit.h Examining data/libtickit-0.4.1/src/bindings.c Examining data/libtickit-0.4.1/src/bindings.h Examining data/libtickit-0.4.1/src/debug.c Examining data/libtickit-0.4.1/src/evloop-default.c Examining data/libtickit-0.4.1/src/mockterm.c Examining data/libtickit-0.4.1/src/pen.c Examining data/libtickit-0.4.1/src/rect.c Examining data/libtickit-0.4.1/src/rectset.c Examining data/libtickit-0.4.1/src/renderbuffer.c Examining data/libtickit-0.4.1/src/string.c Examining data/libtickit-0.4.1/src/term.c Examining data/libtickit-0.4.1/src/termdriver-ti.c Examining data/libtickit-0.4.1/src/termdriver-xterm.c Examining data/libtickit-0.4.1/src/termdriver.h Examining data/libtickit-0.4.1/src/tickit.c Examining data/libtickit-0.4.1/src/unicode.h Examining data/libtickit-0.4.1/src/utf8.c Examining data/libtickit-0.4.1/src/window.c Examining data/libtickit-0.4.1/t/01utf8.c Examining data/libtickit-0.4.1/t/02pen.c Examining data/libtickit-0.4.1/t/03rect.c Examining data/libtickit-0.4.1/t/04rectset.c Examining data/libtickit-0.4.1/t/05string.c Examining data/libtickit-0.4.1/t/08bindings.c Examining data/libtickit-0.4.1/t/09debug.c Examining data/libtickit-0.4.1/t/10term-write.c Examining data/libtickit-0.4.1/t/11term-output-screen.c Examining data/libtickit-0.4.1/t/11term-output-xterm.c Examining data/libtickit-0.4.1/t/12term-modes.c Examining data/libtickit-0.4.1/t/13term-pen.c Examining data/libtickit-0.4.1/t/14term-resize.c Examining data/libtickit-0.4.1/t/15term-input.c Examining data/libtickit-0.4.1/t/16term-read.c Examining data/libtickit-0.4.1/t/17term-buffer.c Examining data/libtickit-0.4.1/t/18term-builder.c Examining data/libtickit-0.4.1/t/19term-driver.c Examining data/libtickit-0.4.1/t/20mockterm.c Examining data/libtickit-0.4.1/t/30renderbuffer-span.c Examining data/libtickit-0.4.1/t/31renderbuffer-line.c Examining data/libtickit-0.4.1/t/32renderbuffer-char.c Examining data/libtickit-0.4.1/t/33renderbuffer-clip.c Examining data/libtickit-0.4.1/t/34renderbuffer-save.c Examining data/libtickit-0.4.1/t/35renderbuffer-mask.c Examining data/libtickit-0.4.1/t/36renderbuffer-blit.c Examining data/libtickit-0.4.1/t/37renderbuffer-copy.c Examining data/libtickit-0.4.1/t/40rootwindow.c Examining data/libtickit-0.4.1/t/41window.c Examining data/libtickit-0.4.1/t/42window-expose.c Examining data/libtickit-0.4.1/t/43window-scrolling.c Examining data/libtickit-0.4.1/t/44window-focus.c Examining data/libtickit-0.4.1/t/45window-input.c Examining data/libtickit-0.4.1/t/46window-float.c Examining data/libtickit-0.4.1/t/47window-dragndrop.c Examining data/libtickit-0.4.1/t/48window-refcount.c Examining data/libtickit-0.4.1/t/50tickit.c Examining data/libtickit-0.4.1/t/51tickit-io.c Examining data/libtickit-0.4.1/t/52tickit-timer.c Examining data/libtickit-0.4.1/t/53tickit-later.c Examining data/libtickit-0.4.1/t/59tickit-tick.c Examining data/libtickit-0.4.1/t/60tickit-setup.c Examining data/libtickit-0.4.1/t/mockterm.c Examining data/libtickit-0.4.1/t/taplib-mockterm.h Examining data/libtickit-0.4.1/t/taplib-tickit.c Examining data/libtickit-0.4.1/t/taplib-tickit.h Examining data/libtickit-0.4.1/t/taplib.c Examining data/libtickit-0.4.1/t/taplib.h FINAL RESULTS: data/libtickit-0.4.1/src/debug.c:168:11: [4] (format) snprintf: 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. len = snprintf(NULL, 0, LINE_PREFIX, timestamp, 0, flag) + data/libtickit-0.4.1/src/debug.c:169:7: [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(NULL, 0, fmt, args_copy) + data/libtickit-0.4.1/src/debug.c:177:12: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. s += sprintf(s, LINE_PREFIX, timestamp, (int)(now.tv_usec / 1000), flag); data/libtickit-0.4.1/src/debug.c:178:12: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. s += vsprintf(s, fmt, args); data/libtickit-0.4.1/src/debug.c:187:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(debug_fh, LINE_PREFIX, timestamp, (int)(now.tv_usec / 1000), flag); data/libtickit-0.4.1/src/debug.c:188:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(debug_fh, fmt, args); data/libtickit-0.4.1/src/mockterm.c:491:7: [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(buffer, cell->str); data/libtickit-0.4.1/src/renderbuffer.c:90: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(s, fmt); data/libtickit-0.4.1/src/renderbuffer.c:330:11: [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. len = vsnprintf(buffer, sizeof buffer, fmt, args_for_size); data/libtickit-0.4.1/src/renderbuffer.c:339:3: [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(rb->tmp, rb->tmpsize, fmt, args); data/libtickit-0.4.1/src/term.c:926:11: [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. len = vsnprintf(buffer, sizeof buffer, fmt, args_for_size); data/libtickit-0.4.1/src/term.c:937:3: [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(morebuffer, len + 1, fmt, args); data/libtickit-0.4.1/src/term.c:974:16: [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. size_t len = vsnprintf(NULL, 0, fmt, args); data/libtickit-0.4.1/src/term.c:976:3: [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, len + 1, fmt, args2); data/libtickit-0.4.1/t/45window-input.c:23: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(last_event->str, info->str); data/libtickit-0.4.1/t/taplib.c:54:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/libtickit-0.4.1/src/debug.c:38:27: [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. const char *flags_str = getenv("TICKIT_DEBUG_FLAGS"); data/libtickit-0.4.1/src/debug.c:62:15: [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. if((val = getenv("TICKIT_DEBUG_FD")) && val[0]) { data/libtickit-0.4.1/src/debug.c:67:20: [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. else if((val = getenv("TICKIT_DEBUG_FILE")) && val[0]) { data/libtickit-0.4.1/src/term.c:134:30: [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. const char *was_term = getenv("TERM"); data/libtickit-0.4.1/src/term.c:184:24: [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. builder.termtype = getenv("TERM"); data/libtickit-0.4.1/examples/demo-scroll.c:31: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 buf[3]; data/libtickit-0.4.1/examples/demo-scroll.c:33:5: [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(buf, "%c-", "Scroll left "[line]); data/libtickit-0.4.1/examples/demo-scroll.c:37:5: [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(buf, "-%c", "Scroll right"[line]); data/libtickit-0.4.1/examples/demo-scroll.c:112: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 buf[64]; data/libtickit-0.4.1/examples/demo-scroll.c:113:5: [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(buf, "content on line %d here", line); data/libtickit-0.4.1/include/tickit.h:425:5: [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). } open; data/libtickit-0.4.1/src/debug.c:71:7: [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[17]; data/libtickit-0.4.1/src/debug.c:72: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, "tickit-%d.log", getpid()); data/libtickit-0.4.1/src/debug.c:128:14: [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). FILE *fh = fopen(path, "a"); data/libtickit-0.4.1/src/debug.c:159: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 timestamp[9]; data/libtickit-0.4.1/src/rectset.c:52: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(rect, trs->rects + i, sizeof(trs->rects[0])); data/libtickit-0.4.1/src/rectset.c:61: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(rects, trs->rects, n * sizeof(trs->rects[0])); data/libtickit-0.4.1/src/renderbuffer.c:85: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 fmt_with_indent[strlen(fmt) + 3 * rb->depth + 1]; data/libtickit-0.4.1/src/renderbuffer.c:89:12: [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. s += sprintf(s, "| "); data/libtickit-0.4.1/src/renderbuffer.c:324: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[64]; data/libtickit-0.4.1/src/string.c:8: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 str[0]; data/libtickit-0.4.1/src/string.c:17: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(s->str, str, len); data/libtickit-0.4.1/src/term.c:253:18: [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). switch(builder.open) { data/libtickit-0.4.1/src/term.c:690: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[64]; // TODO: should be long enough data/libtickit-0.4.1/src/term.c:896: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(tt->outbuffer + tt->outbuffer_cur, str, space); data/libtickit-0.4.1/src/term.c:920: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[64]; data/libtickit-0.4.1/src/termdriver-ti.c:146: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[64]; data/libtickit-0.4.1/src/termdriver-xterm.c:17: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 dcs_buffer[16]; data/libtickit-0.4.1/src/termdriver-xterm.c:313:8: [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. s += sprintf(s, "\e["); data/libtickit-0.4.1/src/termdriver-xterm.c:315:10: [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. s += sprintf(s, "%d%c", CSI_PARAM(params[i]), data/libtickit-0.4.1/src/termdriver-xterm.c:318:10: [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. s += sprintf(s, "%d", CSI_PARAM(params[pindex-1])); data/libtickit-0.4.1/t/10term-write.c:21: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[1024] = { 0 }; data/libtickit-0.4.1/t/11term-output-screen.c:19: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[1024] = { 0 }; data/libtickit-0.4.1/t/11term-output-xterm.c:17: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[1024] = { 0 }; data/libtickit-0.4.1/t/12term-modes.c:15: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[1024] = { 0 }; data/libtickit-0.4.1/t/13term-pen.c:15: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[1024] = { 0 }; data/libtickit-0.4.1/t/15term-input.c:12: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 keystr[16]; data/libtickit-0.4.1/t/15term-input.c:51: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 events[2]; data/libtickit-0.4.1/t/16term-read.c:12: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 keystr[16]; data/libtickit-0.4.1/t/17term-buffer.c:15: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[1024] = { 0 }; data/libtickit-0.4.1/t/18term-builder.c:38:7: [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[1024] = { 0 }; data/libtickit-0.4.1/t/19term-driver.c:70: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[1024] = { 0 }; data/libtickit-0.4.1/t/30renderbuffer-span.c:10: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[256]; data/libtickit-0.4.1/t/32renderbuffer-char.c:9: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[256]; data/libtickit-0.4.1/t/42window-expose.c:42: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. char buffer[16]; data/libtickit-0.4.1/t/42window-expose.c:43:9: [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, "Line %d", line); data/libtickit-0.4.1/t/42window-expose.c:66: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[80]; data/libtickit-0.4.1/t/45window-input.c:11: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 str[16]; data/libtickit-0.4.1/t/45window-input.c:43: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 *ids[3]; data/libtickit-0.4.1/t/46window-float.c:11: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[90]; data/libtickit-0.4.1/t/60tickit-setup.c:14: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[1024] = { 0 }; data/libtickit-0.4.1/src/debug.c:43:26: [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). endp = flags_str + strlen(flags_str); data/libtickit-0.4.1/src/debug.c:47:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newflag->name, flags_str, endp - flags_str); data/libtickit-0.4.1/src/debug.c:179:12: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. s += sprintf(s, "\n"); data/libtickit-0.4.1/src/mockterm.c:488:34: [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). size_t celllen = cell->str ? strlen(cell->str) : 0; data/libtickit-0.4.1/src/pen.c:391:11: [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). len = strlen(desc); data/libtickit-0.4.1/src/renderbuffer.c:85:24: [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 fmt_with_indent[strlen(fmt) + 3 * rb->depth + 1]; data/libtickit-0.4.1/src/renderbuffer.c:312:57: [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). TickitString *s = tickit_string_new(text, len == -1 ? strlen(text) : len); data/libtickit-0.4.1/src/renderbuffer.c:1250:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, text + start.bytes, bytes); data/libtickit-0.4.1/src/term.c:716:63: [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). (tt->driver->vtable->on_decrqss)(tt->driver, dcs + 3, strlen(dcs + 3)); data/libtickit-0.4.1/src/term.c:889:11: [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). len = strlen(str); data/libtickit-0.4.1/src/term.c:953:49: [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). (*tt->driver->vtable->print)(tt->driver, str, strlen(str)); data/libtickit-0.4.1/src/termdriver-xterm.c:319:3: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(s, "m"); data/libtickit-0.4.1/t/10term-write.c:14:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/10term-write.c:43:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/10term-write.c:54:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/10term-write.c:62:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/10term-write.c:70:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/10term-write.c:78:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/10term-write.c:85:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/10term-write.c:92:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd[0], buffer, sizeof buffer); data/libtickit-0.4.1/t/11term-output-screen.c:13:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/11term-output-xterm.c:11:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/12term-modes.c:9:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/13term-pen.c:9:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/15term-input.c:22:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(keystr, info->str, sizeof(keystr)-1); keystr[sizeof(keystr)-1] = 0; data/libtickit-0.4.1/t/15term-input.c:183:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep((msec+1) * 1000); data/libtickit-0.4.1/t/16term-read.c:19:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(keystr, info->str, sizeof(keystr)-1); keystr[sizeof(keystr)-1] = 0; data/libtickit-0.4.1/t/16term-read.c:62:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep((msec+1) * 1000); data/libtickit-0.4.1/t/17term-buffer.c:9:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/18term-builder.c:19:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/19term-driver.c:56:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); data/libtickit-0.4.1/t/60tickit-setup.c:9:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buffer, bytes, len); ANALYSIS SUMMARY: Hits = 99 Lines analyzed = 17944 in approximately 0.49 seconds (36835 lines/second) Physical Source Lines of Code (SLOC) = 13221 Hits@level = [0] 33 [1] 32 [2] 46 [3] 5 [4] 16 [5] 0 Hits@level+ = [0+] 132 [1+] 99 [2+] 67 [3+] 21 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 9.98412 [1+] 7.48809 [2+] 5.0677 [3+] 1.58838 [4+] 1.2102 [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.