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/kitty-0.19.1/glfw/backend_utils.c Examining data/kitty-0.19.1/glfw/backend_utils.h Examining data/kitty-0.19.1/glfw/cocoa_joystick.h Examining data/kitty-0.19.1/glfw/cocoa_platform.h Examining data/kitty-0.19.1/glfw/context.c Examining data/kitty-0.19.1/glfw/dbus_glfw.c Examining data/kitty-0.19.1/glfw/dbus_glfw.h Examining data/kitty-0.19.1/glfw/egl_context.c Examining data/kitty-0.19.1/glfw/egl_context.h Examining data/kitty-0.19.1/glfw/glfw3.h Examining data/kitty-0.19.1/glfw/glx_context.c Examining data/kitty-0.19.1/glfw/glx_context.h Examining data/kitty-0.19.1/glfw/ibus_glfw.c Examining data/kitty-0.19.1/glfw/ibus_glfw.h Examining data/kitty-0.19.1/glfw/init.c Examining data/kitty-0.19.1/glfw/input.c Examining data/kitty-0.19.1/glfw/internal.h Examining data/kitty-0.19.1/glfw/linux_joystick.c Examining data/kitty-0.19.1/glfw/linux_joystick.h Examining data/kitty-0.19.1/glfw/linux_notify.c Examining data/kitty-0.19.1/glfw/linux_notify.h Examining data/kitty-0.19.1/glfw/main_loop.h Examining data/kitty-0.19.1/glfw/mappings.h Examining data/kitty-0.19.1/glfw/memfd.h Examining data/kitty-0.19.1/glfw/monitor.c Examining data/kitty-0.19.1/glfw/monotonic.c Examining data/kitty-0.19.1/glfw/nsgl_context.h Examining data/kitty-0.19.1/glfw/null_init.c Examining data/kitty-0.19.1/glfw/null_joystick.c Examining data/kitty-0.19.1/glfw/null_joystick.h Examining data/kitty-0.19.1/glfw/null_monitor.c Examining data/kitty-0.19.1/glfw/null_platform.h Examining data/kitty-0.19.1/glfw/null_window.c Examining data/kitty-0.19.1/glfw/osmesa_context.c Examining data/kitty-0.19.1/glfw/osmesa_context.h Examining data/kitty-0.19.1/glfw/posix_thread.c Examining data/kitty-0.19.1/glfw/posix_thread.h Examining data/kitty-0.19.1/glfw/vulkan.c Examining data/kitty-0.19.1/glfw/window.c Examining data/kitty-0.19.1/glfw/wl_cursors.c Examining data/kitty-0.19.1/glfw/wl_cursors.h Examining data/kitty-0.19.1/glfw/wl_init.c Examining data/kitty-0.19.1/glfw/wl_monitor.c Examining data/kitty-0.19.1/glfw/wl_platform.h Examining data/kitty-0.19.1/glfw/wl_window.c Examining data/kitty-0.19.1/glfw/x11_init.c Examining data/kitty-0.19.1/glfw/x11_monitor.c Examining data/kitty-0.19.1/glfw/x11_platform.h Examining data/kitty-0.19.1/glfw/x11_window.c Examining data/kitty-0.19.1/glfw/xkb_glfw.c Examining data/kitty-0.19.1/glfw/xkb_glfw.h Examining data/kitty-0.19.1/kittens/choose/choose-data-types.h Examining data/kitty-0.19.1/kittens/choose/main.c Examining data/kitty-0.19.1/kittens/choose/output.c Examining data/kitty-0.19.1/kittens/choose/score.c Examining data/kitty-0.19.1/kittens/choose/unix_compat.c Examining data/kitty-0.19.1/kittens/choose/vector.h Examining data/kitty-0.19.1/kittens/choose/windows_compat.c Examining data/kitty-0.19.1/kittens/diff/speedup.c Examining data/kitty-0.19.1/kittens/unicode_input/names.h Examining data/kitty-0.19.1/kittens/unicode_input/unicode_names.c Examining data/kitty-0.19.1/kitty/charsets.c Examining data/kitty-0.19.1/kitty/charsets.h Examining data/kitty-0.19.1/kitty/child-monitor.c Examining data/kitty-0.19.1/kitty/child.c Examining data/kitty-0.19.1/kitty/colors.c Examining data/kitty-0.19.1/kitty/control-codes.h Examining data/kitty-0.19.1/kitty/cursor.c Examining data/kitty-0.19.1/kitty/data-types.c Examining data/kitty-0.19.1/kitty/data-types.h Examining data/kitty-0.19.1/kitty/desktop.c Examining data/kitty-0.19.1/kitty/emoji.h Examining data/kitty-0.19.1/kitty/fontconfig.c Examining data/kitty-0.19.1/kitty/fonts.c Examining data/kitty-0.19.1/kitty/fonts.h Examining data/kitty-0.19.1/kitty/freetype.c Examining data/kitty-0.19.1/kitty/gl-wrapper.c Examining data/kitty-0.19.1/kitty/gl-wrapper.h Examining data/kitty-0.19.1/kitty/gl.c Examining data/kitty-0.19.1/kitty/gl.h Examining data/kitty-0.19.1/kitty/glfw-wrapper.c Examining data/kitty-0.19.1/kitty/glfw-wrapper.h Examining data/kitty-0.19.1/kitty/glfw.c Examining data/kitty-0.19.1/kitty/graphics.c Examining data/kitty-0.19.1/kitty/graphics.h Examining data/kitty-0.19.1/kitty/history.c Examining data/kitty-0.19.1/kitty/hyperlink.c Examining data/kitty-0.19.1/kitty/hyperlink.h Examining data/kitty-0.19.1/kitty/keys.c Examining data/kitty-0.19.1/kitty/keys.h Examining data/kitty-0.19.1/kitty/kittens.c Examining data/kitty-0.19.1/kitty/line-buf.c Examining data/kitty-0.19.1/kitty/line.c Examining data/kitty-0.19.1/kitty/lineops.h Examining data/kitty-0.19.1/kitty/logging.c Examining data/kitty-0.19.1/kitty/loop-utils.c Examining data/kitty-0.19.1/kitty/loop-utils.h Examining data/kitty-0.19.1/kitty/macos_process_info.c Examining data/kitty-0.19.1/kitty/modes.h Examining data/kitty-0.19.1/kitty/monotonic.c Examining data/kitty-0.19.1/kitty/monotonic.h Examining data/kitty-0.19.1/kitty/mouse.c Examining data/kitty-0.19.1/kitty/parse-graphics-command.h Examining data/kitty-0.19.1/kitty/parser.c Examining data/kitty-0.19.1/kitty/png-reader.c Examining data/kitty-0.19.1/kitty/png-reader.h Examining data/kitty-0.19.1/kitty/rewrap.h Examining data/kitty-0.19.1/kitty/screen.c Examining data/kitty-0.19.1/kitty/screen.h Examining data/kitty-0.19.1/kitty/shaders.c Examining data/kitty-0.19.1/kitty/state.c Examining data/kitty-0.19.1/kitty/state.h Examining data/kitty-0.19.1/kitty/threading.h Examining data/kitty-0.19.1/kitty/unicode-data.c Examining data/kitty-0.19.1/kitty/unicode-data.h Examining data/kitty-0.19.1/kitty/uthash.h Examining data/kitty-0.19.1/kitty/wcswidth.c Examining data/kitty-0.19.1/kitty/wcswidth.h Examining data/kitty-0.19.1/kitty/wcwidth-std.h Examining data/kitty-0.19.1/launcher.c FINAL RESULTS: data/kitty-0.19.1/glfw/dbus_glfw.c:39:13: [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. int n = vsnprintf(buf, sizeof(buf), fmt, args); data/kitty-0.19.1/glfw/ibus_glfw.c:38:56: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define debug(...) if (_glfw.hints.init.debugKeyboard) printf(__VA_ARGS__); data/kitty-0.19.1/glfw/init.c:145:9: [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(description, sizeof(description), format, vl); data/kitty-0.19.1/glfw/init.c:197: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(error->description, description); data/kitty-0.19.1/glfw/init.c:211:9: [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, format, vl); data/kitty-0.19.1/glfw/internal.h:791:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))); data/kitty-0.19.1/glfw/internal.h:793:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))); data/kitty-0.19.1/glfw/wl_window.c:280: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(name, path); data/kitty-0.19.1/glfw/wl_window.c:281:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(name, template); data/kitty-0.19.1/glfw/x11_window.c:985:21: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(string, data); data/kitty-0.19.1/glfw/xkb_glfw.c:34:56: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define debug(...) if (_glfw.hints.init.debugKeyboard) printf(__VA_ARGS__); data/kitty-0.19.1/kittens/choose/output.c:75:19: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. int num = swprintf(buf, sizeof(buf)/sizeof(buf[0]), L"%u", positions[i]); data/kitty-0.19.1/kitty/child.c:129:13: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(exe, argv); data/kitty-0.19.1/kitty/child.c:137:13: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp("sh", "sh", "-c", "read w", NULL); data/kitty-0.19.1/kitty/colors.c:149:21: [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. #define S(which, i) snprintf(key, sizeof(key) - 1, "mark%zu_" #which, i); patch_mark_color(key, profiles, spec, mark_##which##s, i) data/kitty-0.19.1/kitty/data-types.h:38:62: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void log_error(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); data/kitty-0.19.1/kitty/data-types.h:332:63: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void log_event(const char *format, ...) __attribute__((format(printf, 1, 2))); data/kitty-0.19.1/kitty/gl-wrapper.h:1568:73: [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. typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); data/kitty-0.19.1/kitty/gl-wrapper.h:1569:118: [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. typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); data/kitty-0.19.1/kitty/gl-wrapper.h:2864:31: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. #define GLAD_IMPL_UTIL_SSCANF sscanf data/kitty-0.19.1/kitty/gl-wrapper.h:4369:78: [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. static void * GLAD_API_PTR glad_debug_impl_glMapBuffer(GLenum target, GLenum access) { data/kitty-0.19.1/kitty/gl-wrapper.h:4371:85: [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. _pre_call_gl_callback("glMapBuffer", (GLADapiproc) glad_glMapBuffer, 2, target, access); data/kitty-0.19.1/kitty/gl-wrapper.h:4372:36: [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. ret = glad_glMapBuffer(target, access); data/kitty-0.19.1/kitty/gl-wrapper.h:4373:100: [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. _post_call_gl_callback((void*) &ret, "glMapBuffer", (GLADapiproc) glad_glMapBuffer, 2, target, access); data/kitty-0.19.1/kitty/gl-wrapper.h:4378:123: [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. static void * GLAD_API_PTR glad_debug_impl_glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) { data/kitty-0.19.1/kitty/gl-wrapper.h:4380:111: [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. _pre_call_gl_callback("glMapBufferRange", (GLADapiproc) glad_glMapBufferRange, 4, target, offset, length, access); data/kitty-0.19.1/kitty/gl-wrapper.h:4381:57: [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. ret = glad_glMapBufferRange(target, offset, length, access); data/kitty-0.19.1/kitty/gl-wrapper.h:4382:126: [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. _post_call_gl_callback((void*) &ret, "glMapBufferRange", (GLADapiproc) glad_glMapBufferRange, 4, target, offset, length, access); data/kitty-0.19.1/kitty/gl.c:238:32: [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. map_buffer(ssize_t idx, GLenum access) { data/kitty-0.19.1/kitty/gl.c:239:49: [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. void *ans = glMapBuffer(buffers[idx].usage, access); data/kitty-0.19.1/kitty/gl.c:352:55: [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. map_vao_buffer(ssize_t vao_idx, size_t bufnum, GLenum access) { data/kitty-0.19.1/kitty/gl.c:355:32: [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. return map_buffer(buf_idx, access); data/kitty-0.19.1/kitty/gl.c:359:96: [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. alloc_and_map_vao_buffer(ssize_t vao_idx, GLsizeiptr size, size_t bufnum, GLenum usage, GLenum access) { data/kitty-0.19.1/kitty/gl.c:361:32: [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. return map_buffer(buf_idx, access); data/kitty-0.19.1/kitty/gl.h:52:102: [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. void* alloc_and_map_vao_buffer(ssize_t vao_idx, GLsizeiptr size, size_t bufnum, GLenum usage, GLenum access); data/kitty-0.19.1/kitty/gl.h:54:61: [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. void* map_vao_buffer(ssize_t vao_idx, size_t bufnum, GLenum access); data/kitty-0.19.1/kitty/glfw-wrapper.c:9:26: [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. #define fail(msg, ...) { snprintf(buf, sizeof(buf), msg, __VA_ARGS__); return buf; } data/kitty-0.19.1/kitty/glfw.c:91:9: [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, format, vl); data/kitty-0.19.1/kitty/graphics.c:149:5: [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(add_response + num, sz - num, fmt, args); data/kitty-0.19.1/kitty/keys.c:123:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define debug(...) if (OPT(debug_keyboard)) printf(__VA_ARGS__); data/kitty-0.19.1/kitty/logging.c:39:17: [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. snprintf(tbuf, sizeof(tbuf), buf, tv.tv_usec); data/kitty-0.19.1/kitty/logging.c:45:32: [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. if (use_os_log) { bufprint(vsnprintf, fmt, ar); } data/kitty-0.19.1/kitty/logging.c:46:10: [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. else vfprintf(stderr, fmt, ar); data/kitty-0.19.1/kitty/parser.c:460:19: [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. int ret = snprintf(buf + pos, sizeof(buf) - pos - 1, fmt, params[i-1]); data/kitty-0.19.1/kitty/uthash.h:522:29: [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. #define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) data/kitty-0.19.1/launcher.c:47:5: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(buf, PATH_MAX, L"bundle_exe_dir=%ls", exe_dir); data/kitty-0.19.1/launcher.c:50:9: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(buf, PATH_MAX, L"lc_ctype_before_python=%s", lc_ctype); data/kitty-0.19.1/launcher.c:76:11: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. num = swprintf(stdlib, PATH_MAX, L"%ls/%s/python%s:%ls/%s/python%s/lib-dynload:%ls/%s/python%s/site-packages", data/kitty-0.19.1/glfw/ibus_glfw.c:55:21: [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 *q = getenv(name); data/kitty-0.19.1/glfw/ibus_glfw.c:155:12: [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. addr = getenv("IBUS_ADDRESS"); data/kitty-0.19.1/glfw/ibus_glfw.c:162:22: [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 *de = getenv("DISPLAY"); data/kitty-0.19.1/glfw/ibus_glfw.c:180:28: [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 *conf_env = getenv("XDG_CONFIG_HOME"); data/kitty-0.19.1/glfw/ibus_glfw.c:184: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. conf_env = getenv("HOME"); data/kitty-0.19.1/glfw/wl_cursors.c:16: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 *env = getenv("XCURSOR_SIZE"); data/kitty-0.19.1/glfw/wl_cursors.c:42:56: [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. struct wl_cursor_theme *ans = wl_cursor_theme_load(getenv("XCURSOR_THEME"), pixels_from_scale(scale), _glfw.wl.shm); data/kitty-0.19.1/glfw/wl_window.c:272:12: [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. path = getenv("XDG_RUNTIME_DIR"); data/kitty-0.19.1/glfw/x11_init.c:621:31: [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* display = getenv("DISPLAY"); data/kitty-0.19.1/glfw/x11_window.c:677:40: [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* resourceName = getenv("RESOURCE_NAME"); data/kitty-0.19.1/glfw/xkb_glfw.c:358:26: [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 *locale = getenv("LC_ALL"); data/kitty-0.19.1/glfw/xkb_glfw.c:359: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. if (!locale) locale = getenv("LC_CTYPE"); data/kitty-0.19.1/glfw/xkb_glfw.c:360: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. if (!locale) locale = getenv("LANG"); data/kitty-0.19.1/kitty/logging.c:71:9: [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 (getenv("KITTY_LAUNCHED_BY_LAUNCH_SERVICES") != NULL) use_os_log = true; data/kitty-0.19.1/launcher.c:36:17: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char* ans = realpath(src, NULL); data/kitty-0.19.1/launcher.c:154: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. const char *path = getenv("PATH"); data/kitty-0.19.1/launcher.c:182:16: [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. lc_ctype = getenv("LC_CTYPE"); data/kitty-0.19.1/glfw/backend_utils.c:219:12: [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 drain_buf[64]; data/kitty-0.19.1/glfw/backend_utils.c:349: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(result, source, length); data/kitty-0.19.1/glfw/cocoa_platform.h:176: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 keyName[64]; data/kitty-0.19.1/glfw/cocoa_platform.h:177: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 text[256]; data/kitty-0.19.1/glfw/dbus_glfw.c:36:12: [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 buf[1024]; data/kitty-0.19.1/glfw/dbus_glfw.c:219:12: [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 buf[1024]; data/kitty-0.19.1/glfw/glfw3.h:1870: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 buttons[15]; data/kitty-0.19.1/glfw/ibus_glfw.c:154:12: [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 ans[PATH_MAX]; data/kitty-0.19.1/glfw/ibus_glfw.c:202:12: [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 buf[1024]; data/kitty-0.19.1/glfw/ibus_glfw.c:204:23: [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 *addr_file = fopen(ibus->address_file_name, "r"); data/kitty-0.19.1/glfw/ibus_glfw.c:421: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(ev, ev_, sizeof(_GLFWIBUSKeyEvent)); data/kitty-0.19.1/glfw/ibus_glfw.h:46: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 __embedded_text[64]; data/kitty-0.19.1/glfw/init.c:123: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(result, source, length); data/kitty-0.19.1/glfw/init.c:138: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 description[_GLFW_MESSAGE_SIZE]; data/kitty-0.19.1/glfw/init.c:153:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The GLFW library is not initialized"); data/kitty-0.19.1/glfw/init.c:155:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "There is no current context"); data/kitty-0.19.1/glfw/init.c:157:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "Invalid argument for enum parameter"); data/kitty-0.19.1/glfw/init.c:159:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "Invalid value for parameter"); data/kitty-0.19.1/glfw/init.c:161:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "Out of memory"); data/kitty-0.19.1/glfw/init.c:163:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The requested API is unavailable"); data/kitty-0.19.1/glfw/init.c:165:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The requested API version is unavailable"); data/kitty-0.19.1/glfw/init.c:167:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "A platform-specific error occurred"); data/kitty-0.19.1/glfw/init.c:169:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The requested format is unavailable"); data/kitty-0.19.1/glfw/init.c:171:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The specified window has no context"); data/kitty-0.19.1/glfw/init.c:173:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The requested feature cannot be implemented for this platform"); data/kitty-0.19.1/glfw/init.c:175:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "The requested feature has not yet been implemented for this platform"); data/kitty-0.19.1/glfw/init.c:177:13: [2] (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). Risk is low because the source is a constant string. strcpy(description, "ERROR: UNKNOWN GLFW ERROR"); data/kitty-0.19.1/glfw/input.c:173: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(mapping->guid, c, length); data/kitty-0.19.1/glfw/input.c:183: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(mapping->name, c, length); data/kitty-0.19.1/glfw/input.c:1344:13: [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 line[1024]; data/kitty-0.19.1/glfw/input.c:1351:17: [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(line, c, length); data/kitty-0.19.1/glfw/internal.h:171: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 extensionName[256]; data/kitty-0.19.1/glfw/internal.h:267: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 description[_GLFW_MESSAGE_SIZE]; data/kitty-0.19.1/glfw/internal.h:309: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 frameName[256]; data/kitty-0.19.1/glfw/internal.h:312: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 className[256]; data/kitty-0.19.1/glfw/internal.h:313: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 instanceName[256]; data/kitty-0.19.1/glfw/internal.h:316: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 appId[256]; data/kitty-0.19.1/glfw/internal.h:433: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 mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1]; data/kitty-0.19.1/glfw/internal.h:434: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 keys[GLFW_KEY_LAST + 1]; data/kitty-0.19.1/glfw/internal.h:513: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 name[128]; data/kitty-0.19.1/glfw/internal.h:514: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 guid[33]; data/kitty-0.19.1/glfw/internal.h:532: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 guid[33]; data/kitty-0.19.1/glfw/linux_joystick.c:65:22: [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 char stateMap[3][3] = data/kitty-0.19.1/glfw/linux_joystick.c:138:16: [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). linjs.fd = open(path, O_RDONLY | O_NONBLOCK); data/kitty-0.19.1/glfw/linux_joystick.c:142: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 evBits[(EV_CNT + 7) / 8] = {0}; data/kitty-0.19.1/glfw/linux_joystick.c:143: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 keyBits[(KEY_CNT + 7) / 8] = {0}; data/kitty-0.19.1/glfw/linux_joystick.c:144: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 absBits[(ABS_CNT + 7) / 8] = {0}; data/kitty-0.19.1/glfw/linux_joystick.c:166: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 name[256] = ""; data/kitty-0.19.1/glfw/linux_joystick.c:171: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 guid[33] = ""; data/kitty-0.19.1/glfw/linux_joystick.c:176: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(guid, "%02x%02x0000%02x%02x0000%02x%02x0000%02x%02x0000", data/kitty-0.19.1/glfw/linux_joystick.c:184: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(guid, "%02x%02x0000%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x00", data/kitty-0.19.1/glfw/linux_joystick.c:234: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(&js->linjs, &linjs, sizeof(linjs)); data/kitty-0.19.1/glfw/linux_joystick.c:273: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[16384]; data/kitty-0.19.1/glfw/linux_joystick.c:286: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 path[PATH_MAX]; data/kitty-0.19.1/glfw/linux_joystick.c:347:13: [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[PATH_MAX]; data/kitty-0.19.1/glfw/linux_joystick.h:41: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 path[PATH_MAX]; data/kitty-0.19.1/glfw/null_monitor.c:140: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(ramp->red, monitor->null.ramp.red, sizeof(short) * ramp->size); data/kitty-0.19.1/glfw/null_monitor.c:141: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(ramp->green, monitor->null.ramp.green, sizeof(short) * ramp->size); data/kitty-0.19.1/glfw/null_monitor.c:142: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(ramp->blue, monitor->null.ramp.blue, sizeof(short) * ramp->size); data/kitty-0.19.1/glfw/null_monitor.c:155: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(monitor->null.ramp.red, ramp->red, sizeof(short) * ramp->size); data/kitty-0.19.1/glfw/null_monitor.c:156: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(monitor->null.ramp.green, ramp->green, sizeof(short) * ramp->size); data/kitty-0.19.1/glfw/null_monitor.c:157: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(monitor->null.ramp.blue, ramp->blue, sizeof(short) * ramp->size); data/kitty-0.19.1/glfw/wl_cursors.c:18:32: [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). const int retval = atoi(env); data/kitty-0.19.1/glfw/wl_monitor.c:50: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 name[1024]; data/kitty-0.19.1/glfw/wl_platform.h:137: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 appId[256]; data/kitty-0.19.1/glfw/wl_window.c:202:12: [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 buf[128] = {0}; data/kitty-0.19.1/glfw/wl_window.c:1177:12: [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 tty[L_ctermid + 1]; data/kitty-0.19.1/glfw/wl_window.c:1178:14: [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). int fd = open(ctermid(tty), O_WRONLY | O_CLOEXEC); data/kitty-0.19.1/glfw/x11_init.c:445: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 name[32]; data/kitty-0.19.1/glfw/x11_init.c:509: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 pixels[16 * 16 * 4] = { 0 }; data/kitty-0.19.1/glfw/x11_init.c:565: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[_GLFW_MESSAGE_SIZE]; data/kitty-0.19.1/glfw/x11_monitor.c:120:13: [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(disconnected, data/kitty-0.19.1/glfw/x11_monitor.c:538:9: [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(ramp->red, gamma->red, size * sizeof(unsigned short)); data/kitty-0.19.1/glfw/x11_monitor.c:539:9: [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(ramp->green, gamma->green, size * sizeof(unsigned short)); data/kitty-0.19.1/glfw/x11_monitor.c:540:9: [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(ramp->blue, gamma->blue, size * sizeof(unsigned short)); data/kitty-0.19.1/glfw/x11_monitor.c:578:9: [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(gamma->red, ramp->red, ramp->size * sizeof(unsigned short)); data/kitty-0.19.1/glfw/x11_monitor.c:579:9: [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(gamma->green, ramp->green, ramp->size * sizeof(unsigned short)); data/kitty-0.19.1/glfw/x11_monitor.c:580:9: [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(gamma->blue, ramp->blue, ramp->size * sizeof(unsigned short)); data/kitty-0.19.1/glfw/x11_platform.h:337: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 format[128]; data/kitty-0.19.1/glfw/x11_window.c:465: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 mask[XIMaskLen(XI_RawMotion)] = { 0 }; data/kitty-0.19.1/glfw/xkb_glfw.c:474:12: [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 name[256]; data/kitty-0.19.1/glfw/xkb_glfw.c:487:12: [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 buf[128]; data/kitty-0.19.1/glfw/xkb_glfw.c:507:12: [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 buf[512]; data/kitty-0.19.1/glfw/xkb_glfw.c:578:12: [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 key_text[64] = {0}; data/kitty-0.19.1/kittens/choose/output.c:43:9: [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(global->output + global->output_pos, data, sizeof(text_t) * sz); data/kitty-0.19.1/kittens/choose/output.c:73:5: [2] (buffer) wchar_t: 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. wchar_t buf[128]; data/kitty-0.19.1/kitty/child-monitor.c:264:17: [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(screen->write_buf + screen->write_buf_used, data, dsz); data/kitty-0.19.1/kitty/child-monitor.c:364:13: [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(msgs, self->messages, sizeof(Message) * self->messages_count); data/kitty-0.19.1/kitty/child-monitor.c:638: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 text[32] = {0}; data/kitty-0.19.1/kitty/child-monitor.c:800: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(data->buf, buf, data->sz); data/kitty-0.19.1/kitty/child-monitor.c:1365:13: [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(m->data, peer->read.data, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1542:26: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (msg) memcpy(peer->write.data + peer->write.used, msg, msg_sz); data/kitty-0.19.1/kitty/child.c:29:9: [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(ans[i], pysrc, len); data/kitty-0.19.1/kitty/child.c:76: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 name[2048] = {0}; data/kitty-0.19.1/kitty/child.c:96:23: [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). int tfd = open(name, O_RDWR); data/kitty-0.19.1/kitty/colors.c:70:9: [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(self->color_table, FG_BG_256, sizeof(FG_BG_256)); data/kitty-0.19.1/kitty/colors.c:71:9: [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(self->orig_color_table, FG_BG_256, sizeof(FG_BG_256)); data/kitty-0.19.1/kitty/colors.c:107: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(dest->orig_color_table, src->orig_color_table, sizeof(dest->color_table)); data/kitty-0.19.1/kitty/colors.c:143: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 key[32] = {0}; data/kitty-0.19.1/kitty/colors.c:217:16: [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 buf[32] = {0}; data/kitty-0.19.1/kitty/colors.c:269: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(self->color_table, self->orig_color_table, sizeof(FG_BG_256)); data/kitty-0.19.1/kitty/data-types.c:34:12: [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 buf[1024]; data/kitty-0.19.1/kitty/data-types.c:112:12: [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 ctty[L_ctermid+1]; data/kitty-0.19.1/kitty/data-types.c:113:14: [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). int fd = open(ctermid(ctty), flags); data/kitty-0.19.1/kitty/fonts.c:283: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(&s->extra_glyphs, extra_glyphs, sizeof(ExtraGlyphs)); data/kitty-0.19.1/kitty/fonts.c:384:25: [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(f->ffs_hb_features + i, PyBytes_AS_STRING(parsed), sizeof(hb_feature_t)); data/kitty-0.19.1/kitty/fonts.c:388:17: [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(f->ffs_hb_features + len, &hb_features[CALT_FEATURE], sizeof(hb_feature_t)); data/kitty-0.19.1/kitty/fonts.c:396:13: [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(f->ffs_hb_features + f->num_ffs_hb_features++, &hb_features[LIGA_FEATURE], sizeof(hb_feature_t)); data/kitty-0.19.1/kitty/fonts.c:397:13: [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(f->ffs_hb_features + f->num_ffs_hb_features++, &hb_features[DLIG_FEATURE], sizeof(hb_feature_t)); data/kitty-0.19.1/kitty/fonts.c:399:9: [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(f->ffs_hb_features + f->num_ffs_hb_features++, &hb_features[CALT_FEATURE], sizeof(hb_feature_t)); data/kitty-0.19.1/kitty/fonts.c:724:95: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. for (unsigned int r = 0; r < fg->cell_height; r++, dest += fg->cell_width, src += stride) memcpy(dest, src, fg->cell_width * sizeof(pixel)); data/kitty-0.19.1/kitty/fonts.c:892:16: [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 dbuf[1024]; data/kitty-0.19.1/kitty/freetype.c:398:9: [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(ans->buf, bitmap->buffer, ans->rows * ans->stride); data/kitty-0.19.1/kitty/gl-wrapper.h:6019:17: [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(local_str, gl_str_tmp, len * sizeof(char)); data/kitty-0.19.1/kitty/gl.c:105:16: [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 glbuf[4096]; data/kitty-0.19.1/kitty/gl.h:23: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 name[256]; data/kitty-0.19.1/kitty/glfw-wrapper.c:13:12: [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 buf[2048]; data/kitty-0.19.1/kitty/glfw-wrapper.h:1608: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 buttons[15]; data/kitty-0.19.1/kitty/glfw.c:408:22: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (logo.pixels) memcpy(logo.pixels, logo_data, sz); data/kitty-0.19.1/kitty/graphics.c:140:8: [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 add_response[512] = {0}; data/kitty-0.19.1/kitty/graphics.c:177:12: [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 buf[128]; data/kitty-0.19.1/kitty/graphics.c:252:16: [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* fp = fopen(path, "r"); data/kitty-0.19.1/kitty/graphics.c:382:12: [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 fname[2056] = {0}; data/kitty-0.19.1/kitty/graphics.c:394:13: [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(img->load_data.buf + img->load_data.buf_used, payload, g->payload_sz); data/kitty-0.19.1/kitty/graphics.c:404:23: [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). else fd = open(fname, O_CLOEXEC | O_RDONLY); data/kitty-0.19.1/kitty/graphics.c:479:12: [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 rbuf[sizeof(add_response)/sizeof(add_response[0]) + 64]; data/kitty-0.19.1/kitty/graphics.c:912: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(addr, data, sz); data/kitty-0.19.1/kitty/history.c:85:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (copied) memcpy(newbuf, ph->buffer + ph->start, copied); data/kitty-0.19.1/kitty/history.c:86:30: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (copied < ph->length) memcpy(newbuf + copied, ph->buffer, (ph->length - copied)); data/kitty-0.19.1/kitty/history.c:201:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (copied) memcpy(ph->buffer + start_writing_at, buf, copied); data/kitty-0.19.1/kitty/history.c:202:22: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (copied < sz) memcpy(ph->buffer, buf + copied, (sz - copied)); data/kitty-0.19.1/kitty/history.c:432:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (copied) memcpy(buf, ph->buffer + ph->start, copied); data/kitty-0.19.1/kitty/history.c:433:30: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (copied < ph->length) memcpy(buf + copied, ph->buffer, (ph->length - copied)); data/kitty-0.19.1/kitty/history.c:557:13: [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(other->segments[i].cpu_cells, self->segments[i].cpu_cells, SEGMENT_SIZE * self->xnum * sizeof(CPUCell)); data/kitty-0.19.1/kitty/history.c:558:13: [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(other->segments[i].gpu_cells, self->segments[i].gpu_cells, SEGMENT_SIZE * self->xnum * sizeof(GPUCell)); data/kitty-0.19.1/kitty/history.c:559:13: [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(other->segments[i].line_attrs, self->segments[i].line_attrs, SEGMENT_SIZE * sizeof(line_attrs_type)); data/kitty-0.19.1/kitty/hyperlink.c:103:12: [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 key[MAX_KEY_LEN] = {0}; data/kitty-0.19.1/kitty/hyperlink.c:132: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((void*)s->key, key, keylen + 1); data/kitty-0.19.1/kitty/kittens.c:15:12: [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. append_buf(char buf[CMD_BUF_SZ], size_t *pos, PyObject *ans) { data/kitty-0.19.1/kitty/kittens.c:28: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. add_char(char buf[CMD_BUF_SZ], size_t *pos, char ch, PyObject *ans) { data/kitty-0.19.1/kitty/kittens.c:39:12: [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 buf[CMD_BUF_SZ]; data/kitty-0.19.1/kitty/line-buf.c:546:9: [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(other->line_map, self->line_map, sizeof(index_type) * self->ynum); data/kitty-0.19.1/kitty/line-buf.c:547:9: [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(other->line_attrs, self->line_attrs, sizeof(bool) * self->ynum); data/kitty-0.19.1/kitty/line-buf.c:548:9: [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(other->cpu_cell_buf, self->cpu_cell_buf, (size_t)self->xnum * self->ynum * sizeof(CPUCell)); data/kitty-0.19.1/kitty/line-buf.c:549:9: [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(other->gpu_cell_buf, self->gpu_cell_buf, (size_t)self->xnum * self->ynum * sizeof(GPUCell)); data/kitty-0.19.1/kitty/line.c:662:12: [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 buf[128]; data/kitty-0.19.1/kitty/line.c:664:56: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define P(s) { size_t len = strlen(s); if (SZ > len) { memcpy(p, s, len); p += len; } } data/kitty-0.19.1/kitty/lineops.h:23: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(dest->cpu_cells, src->cpu_cells, sizeof(CPUCell) * MIN(src->xnum, dest->xnum)); data/kitty-0.19.1/kitty/lineops.h:24: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(dest->gpu_cells, src->gpu_cells, sizeof(GPUCell) * MIN(src->xnum, dest->xnum)); data/kitty-0.19.1/kitty/lineops.h:47: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(gpu_cells + start, line->gpu_cells + start, sizeof(GPUCell) * num); data/kitty-0.19.1/kitty/lineops.h:48: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(cpu_cells + start, line->cpu_cells + start, sizeof(CPUCell) * num); data/kitty-0.19.1/kitty/lineops.h:53: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(line->gpu_cells + start, gpu_cells + start, sizeof(GPUCell) * num); data/kitty-0.19.1/kitty/lineops.h:54: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(line->cpu_cells + start, cpu_cells + start, sizeof(CPUCell) * num); data/kitty-0.19.1/kitty/logging.c:26: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 logbuf[16 * 1024] = {0}; data/kitty-0.19.1/kitty/logging.c:28: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 logbuf[4]; data/kitty-0.19.1/kitty/logging.c:37:13: [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 tbuf[256] = {0}, buf[256] = {0}; data/kitty-0.19.1/kitty/loop-utils.c:137:12: [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 buf[256]; data/kitty-0.19.1/kitty/macos_process_info.c:221:9: [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(procenv + (arg_ptr - env_start), arg_ptr, s - arg_ptr); data/kitty-0.19.1/kitty/mouse.c:65:8: [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 mouse_event_buf[64]; data/kitty-0.19.1/kitty/parser.c:46:12: [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 buf[8]; data/kitty-0.19.1/kitty/parser.c:84:12: [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 buf[MAX_PARAMS*3] = {0}; data/kitty-0.19.1/kitty/parser.c:456:12: [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 buf[256]; data/kitty-0.19.1/kitty/png-reader.c:21:9: [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(out, f->buf + f->cur, amt); data/kitty-0.19.1/kitty/rewrap.h:47: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(dest->cpu_cells + dest_at, src->cpu_cells + src_at, num * sizeof(CPUCell)); data/kitty-0.19.1/kitty/rewrap.h:48: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(dest->gpu_cells + dest_at, src->gpu_cells + src_at, num * sizeof(GPUCell)); data/kitty-0.19.1/kitty/screen.c:1423: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[32] = {0}; data/kitty-0.19.1/kitty/screen.c:1463:12: [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 buf[64]; data/kitty-0.19.1/kitty/screen.c:1486: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[50] = {0}; data/kitty-0.19.1/kitty/screen.c:1612:12: [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 buf[128]; data/kitty-0.19.1/kitty/screen.c:1655: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(data + base, line->gpu_cells, line->xnum * sizeof(GPUCell)); data/kitty-0.19.1/kitty/shaders.c:248:55: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. for (size_t i = 0; i < image_count; i++, a += 16) memcpy(a, render_data[i].vertices, sizeof(render_data[0].vertices)); data/kitty-0.19.1/kitty/shaders.c:700:38: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (borders_buf_address) memcpy(borders_buf_address, rect_buf, sz); data/kitty-0.19.1/kitty/shaders.c:741:16: [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 glbuf[4096]; data/kitty-0.19.1/kitty/state.c:277: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(detached_windows.windows + detached_windows.num_windows++, w, sizeof(Window)); data/kitty-0.19.1/kitty/state.c:314:17: [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(w, detached_windows.windows + i, sizeof(Window)); data/kitty-0.19.1/kitty/state.c:553:32: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (OPT(background_image)) memcpy(OPT(background_image), s, sz); data/kitty-0.19.1/launcher.c:46:5: [2] (buffer) wchar_t: 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. wchar_t buf[PATH_MAX+1] = {0}; data/kitty-0.19.1/launcher.c:70:5: [2] (buffer) wchar_t: 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. wchar_t stdlib[PATH_MAX+1] = {0}; data/kitty-0.19.1/launcher.c:123: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 apple[PATH_MAX+1] = {0}; data/kitty-0.19.1/launcher.c:156: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[PATH_MAX + 1] = {0}; data/kitty-0.19.1/launcher.c:160: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 q[PATH_MAX + 1] = {0}; data/kitty-0.19.1/launcher.c:179: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 exe[PATH_MAX+1] = {0}; data/kitty-0.19.1/launcher.c:188: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 lib[PATH_MAX+1] = {0}; data/kitty-0.19.1/launcher.c:189: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 *final_argv[MAX_ARGC + 1] = {0}; data/kitty-0.19.1/launcher.c:190:5: [2] (buffer) wchar_t: 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. wchar_t *argvw[MAX_ARGC + 1] = {0}; data/kitty-0.19.1/glfw/backend_utils.c:222:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t ret = read(fd, drain_buf, sizeof(drain_buf)); data/kitty-0.19.1/glfw/context.c:229: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). const size_t length = strlen(prefixes[i]); data/kitty-0.19.1/glfw/context.c:427:30: [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). terminator = where + strlen(string); data/kitty-0.19.1/glfw/ibus_glfw.c:158:36: [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). memcpy(ans, addr, GLFW_MIN(strlen(addr), sizeof(ans))); data/kitty-0.19.1/glfw/ibus_glfw.c:213:25: [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 sz = strlen(buf); data/kitty-0.19.1/glfw/ibus_glfw.c:423:27: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). if (ev->glfw_ev.text) strncpy(ev->__embedded_text, ev->glfw_ev.text, sizeof(ev->__embedded_text) - 1); data/kitty-0.19.1/glfw/init.c:121: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). const size_t length = strlen(source); data/kitty-0.19.1/glfw/input.c:194:22: [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). length = strlen(fields[i].name); data/kitty-0.19.1/glfw/input.c:249: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). length = strlen(_GLFW_PLATFORM_MAPPING_NAME); data/kitty-0.19.1/glfw/input.c:449:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(js->guid, guid, sizeof(js->guid) - 1); data/kitty-0.19.1/glfw/linux_joystick.c:169:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(name, "Unknown", sizeof(name)); data/kitty-0.19.1/glfw/linux_joystick.c:233:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(linjs.path, path, sizeof(linjs.path) - 1); data/kitty-0.19.1/glfw/linux_joystick.c:274:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). const ssize_t size = read(_glfw.linjs.inotify, buffer, sizeof(buffer)); data/kitty-0.19.1/glfw/linux_joystick.c:393:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(js->linjs.fd, &e, sizeof(e)) < 0) data/kitty-0.19.1/glfw/window.c:479:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(_glfw.hints.window.ns.frameName, value, data/kitty-0.19.1/glfw/window.c:483:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(_glfw.hints.window.x11.className, value, data/kitty-0.19.1/glfw/window.c:487:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(_glfw.hints.window.x11.instanceName, value, data/kitty-0.19.1/glfw/window.c:491:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(_glfw.hints.window.wl.appId, value, data/kitty-0.19.1/glfw/wl_window.c:279:19: [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). name = calloc(strlen(path) + sizeof(template), 1); data/kitty-0.19.1/glfw/wl_window.c:733: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(window->wl.appId)) data/kitty-0.19.1/glfw/wl_window.c:890:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(window->wl.appId, wndconfig->wl.appId, sizeof(window->wl.appId)); data/kitty-0.19.1/glfw/wl_window.c:1537:22: [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 len = strlen(text), pos = 0; data/kitty-0.19.1/glfw/wl_window.c:1597:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(data_pipe, buf + *data_sz, capacity - *data_sz - 1); data/kitty-0.19.1/glfw/x11_window.c:669: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). if (strlen(wndconfig->x11.instanceName) && data/kitty-0.19.1/glfw/x11_window.c:670: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). strlen(wndconfig->x11.className)) data/kitty-0.19.1/glfw/x11_window.c:678:33: [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 (resourceName && strlen(resourceName)) data/kitty-0.19.1/glfw/x11_window.c:680:22: [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). else if (strlen(wndconfig->title)) data/kitty-0.19.1/glfw/x11_window.c:685:17: [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(wndconfig->title)) data/kitty-0.19.1/glfw/x11_window.c:783:33: [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). strlen(selectionString)); data/kitty-0.19.1/glfw/x11_window.c:835: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). strlen(selectionString)); data/kitty-0.19.1/glfw/x11_window.c:1535:33: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(_glfw.x11.xdnd.format, atom_names[i], arraysz(_glfw.x11.xdnd.format) - 1); data/kitty-0.19.1/glfw/x11_window.c:1971:45: [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). (unsigned char*) title, strlen(title)); data/kitty-0.19.1/glfw/x11_window.c:1976:45: [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). (unsigned char*) title, strlen(title)); data/kitty-0.19.1/glfw/xkb_glfw.c:57:11: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. S(equal, EQUAL); \ data/kitty-0.19.1/kittens/choose/windows_compat.c:72:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(stream); data/kitty-0.19.1/kittens/unicode_input/unicode_names.c:75: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). return codepoints_for_word(word, strlen(word)); data/kitty-0.19.1/kitty/child-monitor.c:311:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(lock, read); data/kitty-0.19.1/kitty/child-monitor.c:326:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(unlock, read); data/kitty-0.19.1/kitty/child-monitor.c:1070:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(lock, read); data/kitty-0.19.1/kitty/child-monitor.c:1072:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (orig_sz >= READ_BUF_SZ) { screen_mutex(unlock, read); return true; } // screen read buffer is full data/kitty-0.19.1/kitty/child-monitor.c:1074:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(unlock, read); data/kitty-0.19.1/kitty/child-monitor.c:1077:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, screen->read_buf + orig_sz, available_buffer_space); data/kitty-0.19.1/kitty/child-monitor.c:1087:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(lock, read); data/kitty-0.19.1/kitty/child-monitor.c:1094:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(unlock, read); data/kitty-0.19.1/kitty/child-monitor.c:1102:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t len = read(fd, drain_buf, sizeof(drain_buf)); data/kitty-0.19.1/kitty/child-monitor.c:1221:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(lock, read); screen_mutex(lock, write); data/kitty-0.19.1/kitty/child-monitor.c:1223:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). screen_mutex(unlock, read); screen_mutex(unlock, write); data/kitty-0.19.1/kitty/child-monitor.c:1306:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). } read; data/kitty-0.19.1/kitty/child-monitor.c:1349:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). free(peer->read.data); peer->read.data = NULL; data/kitty-0.19.1/kitty/child-monitor.c:1349:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). free(peer->read.data); peer->read.data = NULL; data/kitty-0.19.1/kitty/child-monitor.c:1362:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used) { data/kitty-0.19.1/kitty/child-monitor.c:1363:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m->data = malloc(peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1365:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memcpy(m->data, peer->read.data, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1365:52: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memcpy(m->data, peer->read.data, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1366:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m->sz = peer->read.used; data/kitty-0.19.1/kitty/child-monitor.c:1377:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.command_end = 0; data/kitty-0.19.1/kitty/child-monitor.c:1378:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used > sizeof(KITTY_CMD_PREFIX) && memcmp(peer->read.data, KITTY_CMD_PREFIX, sizeof(KITTY_CMD_PREFIX)-1) == 0) { data/kitty-0.19.1/kitty/child-monitor.c:1378:68: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used > sizeof(KITTY_CMD_PREFIX) && memcmp(peer->read.data, KITTY_CMD_PREFIX, sizeof(KITTY_CMD_PREFIX)-1) == 0) { data/kitty-0.19.1/kitty/child-monitor.c:1379:63: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (size_t i = sizeof(KITTY_CMD_PREFIX)-1; i < peer->read.used - 1; i++) { data/kitty-0.19.1/kitty/child-monitor.c:1380:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.data[i] == 0x1b && peer->read.data[i+1] == '\\') { data/kitty-0.19.1/kitty/child-monitor.c:1380:53: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.data[i] == 0x1b && peer->read.data[i+1] == '\\') { data/kitty-0.19.1/kitty/child-monitor.c:1381:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.command_end = i + 2; data/kitty-0.19.1/kitty/child-monitor.c:1386:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return peer->read.command_end ? true : false; data/kitty-0.19.1/kitty/child-monitor.c:1392:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.command_end) { data/kitty-0.19.1/kitty/child-monitor.c:1393:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t used = peer->read.used; data/kitty-0.19.1/kitty/child-monitor.c:1394:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used = peer->read.command_end; data/kitty-0.19.1/kitty/child-monitor.c:1394:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used = peer->read.command_end; data/kitty-0.19.1/kitty/child-monitor.c:1396:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used = used; data/kitty-0.19.1/kitty/child-monitor.c:1397:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used > peer->read.command_end) { data/kitty-0.19.1/kitty/child-monitor.c:1397:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used > peer->read.command_end) { data/kitty-0.19.1/kitty/child-monitor.c:1398:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used -= peer->read.command_end; data/kitty-0.19.1/kitty/child-monitor.c:1398:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used -= peer->read.command_end; data/kitty-0.19.1/kitty/child-monitor.c:1399:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memmove(peer->read.data, peer->read.data + peer->read.command_end, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1399:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memmove(peer->read.data, peer->read.data + peer->read.command_end, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1399:62: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memmove(peer->read.data, peer->read.data + peer->read.command_end, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1399:86: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). memmove(peer->read.data, peer->read.data + peer->read.command_end, peer->read.used); data/kitty-0.19.1/kitty/child-monitor.c:1400:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). } else peer->read.used = 0; data/kitty-0.19.1/kitty/child-monitor.c:1401:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.command_end = 0; data/kitty-0.19.1/kitty/child-monitor.c:1407:106: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define failed(msg) { log_error("Reading from peer failed: %s", msg); shutdown(peer->fd, SHUT_RD); peer->read.finished = true; return; } data/kitty-0.19.1/kitty/child-monitor.c:1408:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used >= peer->read.capacity) { data/kitty-0.19.1/kitty/child-monitor.c:1408:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.used >= peer->read.capacity) { data/kitty-0.19.1/kitty/child-monitor.c:1409:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (peer->read.capacity >= 64 * 1024) failed("Ignoring too large message from peer"); data/kitty-0.19.1/kitty/child-monitor.c:1410:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.capacity = MAX(8192u, peer->read.capacity * 2); data/kitty-0.19.1/kitty/child-monitor.c:1410:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.capacity = MAX(8192u, peer->read.capacity * 2); data/kitty-0.19.1/kitty/child-monitor.c:1411:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.data = realloc(peer->read.data, peer->read.capacity); data/kitty-0.19.1/kitty/child-monitor.c:1411:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.data = realloc(peer->read.data, peer->read.capacity); data/kitty-0.19.1/kitty/child-monitor.c:1411:58: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.data = realloc(peer->read.data, peer->read.capacity); data/kitty-0.19.1/kitty/child-monitor.c:1412:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!peer->read.data) failed("Out of memory"); data/kitty-0.19.1/kitty/child-monitor.c:1414:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = recv(peer->fd, peer->read.data + peer->read.used, peer->read.capacity - peer->read.used, 0); data/kitty-0.19.1/kitty/child-monitor.c:1414:56: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = recv(peer->fd, peer->read.data + peer->read.used, peer->read.capacity - peer->read.used, 0); data/kitty-0.19.1/kitty/child-monitor.c:1414:73: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = recv(peer->fd, peer->read.data + peer->read.used, peer->read.capacity - peer->read.used, 0); data/kitty-0.19.1/kitty/child-monitor.c:1414:95: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = recv(peer->fd, peer->read.data + peer->read.used, peer->read.capacity - peer->read.used, 0); data/kitty-0.19.1/kitty/child-monitor.c:1416:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.finished = true; data/kitty-0.19.1/kitty/child-monitor.c:1420:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). free(peer->read.data); peer->read.data = NULL; data/kitty-0.19.1/kitty/child-monitor.c:1420:38: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). free(peer->read.data); peer->read.data = NULL; data/kitty-0.19.1/kitty/child-monitor.c:1421:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used = 0; peer->read.capacity = 0; data/kitty-0.19.1/kitty/child-monitor.c:1421:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used = 0; peer->read.capacity = 0; data/kitty-0.19.1/kitty/child-monitor.c:1425:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peer->read.used += n; data/kitty-0.19.1/kitty/child-monitor.c:1456:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (p->read.finished && !p->num_of_unresponded_messages_sent_to_main_thread && !p->write.used) { data/kitty-0.19.1/kitty/child-monitor.c:1486:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!p->read.finished || p->write.used) { data/kitty-0.19.1/kitty/child-monitor.c:1490:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!p->read.finished) flags |= POLLIN; data/kitty-0.19.1/kitty/child-monitor.c:1513:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p->read.finished = true; data/kitty-0.19.1/kitty/child.c:26:22: [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 len = strlen(pysrc); data/kitty-0.19.1/kitty/child.c:45:17: [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 sz = strlen(text); data/kitty-0.19.1/kitty/child.c:64:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ret = read(fd, &data, 1); data/kitty-0.19.1/kitty/fontconfig.c:32:48: [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). #define PS(x) PyUnicode_Decode((const char*)x, strlen((const char*)x), "UTF-8", "replace") data/kitty-0.19.1/kitty/fontconfig.c:160:19: [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 (family && strlen(family) > 0) AP(FcPatternAddString, FC_FAMILY, (const FcChar8*)family, "family"); data/kitty-0.19.1/kitty/gl-wrapper.h:6016: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). size_t len = strlen(gl_str_tmp) + 1; data/kitty-0.19.1/kitty/gl-wrapper.h:6053:32: [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). terminator = loc + strlen(ext); data/kitty-0.19.1/kitty/gl-wrapper.h:6099: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). const size_t length = strlen(prefixes[i]); data/kitty-0.19.1/kitty/hyperlink.c:105:30: [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 (keylen < 0) keylen = strlen(key); data/kitty-0.19.1/kitty/hyperlink.c:115:59: [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). HASH_ADD_KEYPTR(hh, pool->hyperlinks, s->key, strlen(s->key), s); data/kitty-0.19.1/kitty/keys.c:146: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). schedule_write_to_child(w->id, 1, text, strlen(text)); data/kitty-0.19.1/kitty/keys.c:195: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). schedule_write_to_child(w->id, 1, text, strlen(text)); data/kitty-0.19.1/kitty/kittens.c:46:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t len = read(fd, &ch, 1); data/kitty-0.19.1/kitty/line.c:664: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). #define P(s) { size_t len = strlen(s); if (SZ > len) { memcpy(p, s, len); p += len; } } data/kitty-0.19.1/kitty/loop-utils.c:121:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t s = read(fd, &fdsi, sizeof(fdsi)); data/kitty-0.19.1/kitty/loop-utils.c:139:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t len = read(fd, buf, sizeof(buf)); data/kitty-0.19.1/kitty/macos_process_info.c:91: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(arg_ptr); data/kitty-0.19.1/kitty/parser.c:320:22: [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 len = strlen(token); data/kitty-0.19.1/kitty/parser.c:869:16: [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 l = strlen(prefix); data/kitty-0.19.1/kitty/screen.c:669:65: [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). schedule_write_to_child(self->window_id, 3, prefix, strlen(prefix), data, strlen(data), suffix, strlen(suffix)); data/kitty-0.19.1/kitty/screen.c:669:87: [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). schedule_write_to_child(self->window_id, 3, prefix, strlen(prefix), data, strlen(data), suffix, strlen(suffix)); data/kitty-0.19.1/kitty/screen.c:669:109: [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). schedule_write_to_child(self->window_id, 3, prefix, strlen(prefix), data, strlen(data), suffix, strlen(suffix)); data/kitty-0.19.1/kitty/screen.c:671:65: [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). schedule_write_to_child(self->window_id, 2, prefix, strlen(prefix), data, strlen(data)); data/kitty-0.19.1/kitty/screen.c:671:87: [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). schedule_write_to_child(self->window_id, 2, prefix, strlen(prefix), data, strlen(data)); data/kitty-0.19.1/kitty/screen.c:675:43: [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). write_to_test_child(self, prefix, strlen(prefix)); data/kitty-0.19.1/kitty/screen.c:676:41: [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). write_to_test_child(self, data, strlen(data)); data/kitty-0.19.1/kitty/screen.c:677:58: [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 (suffix[0]) write_to_test_child(self, suffix, strlen(suffix)); data/kitty-0.19.1/kitty/uthash.h:92: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). #define uthash_strlen(s) strlen(s) data/kitty-0.19.1/launcher.c:157:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, path, PATH_MAX); ANALYSIS SUMMARY: Hits = 381 Lines analyzed = 164745 in approximately 9.00 seconds (18305 lines/second) Physical Source Lines of Code (SLOC) = 149322 Hits@level = [0] 89 [1] 131 [2] 185 [3] 17 [4] 48 [5] 0 Hits@level+ = [0+] 470 [1+] 381 [2+] 250 [3+] 65 [4+] 48 [5+] 0 Hits/KSLOC@level+ = [0+] 3.14756 [1+] 2.55153 [2+] 1.67423 [3+] 0.435301 [4+] 0.321453 [5+] 0 Symlinks skipped = 1 (--allowlink overrides but see doc for security issue) Dot directories skipped = 2 (--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.