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/i3-wm-4.19/i3-config-wizard/i3-config-wizard-atoms.xmacro.h
Examining data/i3-wm-4.19/i3-config-wizard/main.c
Examining data/i3-wm-4.19/i3-config-wizard/xcb.h
Examining data/i3-wm-4.19/i3-dump-log/main.c
Examining data/i3-wm-4.19/i3-input/i3-input.h
Examining data/i3-wm-4.19/i3-input/keysym2ucs.c
Examining data/i3-wm-4.19/i3-input/keysym2ucs.h
Examining data/i3-wm-4.19/i3-input/main.c
Examining data/i3-wm-4.19/i3-msg/main.c
Examining data/i3-wm-4.19/i3-nagbar/i3-nagbar-atoms.xmacro.h
Examining data/i3-wm-4.19/i3-nagbar/main.c
Examining data/i3-wm-4.19/i3bar/include/child.h
Examining data/i3-wm-4.19/i3bar/include/common.h
Examining data/i3-wm-4.19/i3bar/include/configuration.h
Examining data/i3-wm-4.19/i3bar/include/ipc.h
Examining data/i3-wm-4.19/i3bar/include/mode.h
Examining data/i3-wm-4.19/i3bar/include/outputs.h
Examining data/i3-wm-4.19/i3bar/include/parse_json_header.h
Examining data/i3-wm-4.19/i3bar/include/trayclients.h
Examining data/i3-wm-4.19/i3bar/include/util.h
Examining data/i3-wm-4.19/i3bar/include/workspaces.h
Examining data/i3-wm-4.19/i3bar/include/xcb.h
Examining data/i3-wm-4.19/i3bar/src/child.c
Examining data/i3-wm-4.19/i3bar/src/config.c
Examining data/i3-wm-4.19/i3bar/src/ipc.c
Examining data/i3-wm-4.19/i3bar/src/main.c
Examining data/i3-wm-4.19/i3bar/src/mode.c
Examining data/i3-wm-4.19/i3bar/src/outputs.c
Examining data/i3-wm-4.19/i3bar/src/parse_json_header.c
Examining data/i3-wm-4.19/i3bar/src/workspaces.c
Examining data/i3-wm-4.19/i3bar/src/xcb.c
Examining data/i3-wm-4.19/include/all.h
Examining data/i3-wm-4.19/include/assignments.h
Examining data/i3-wm-4.19/include/bindings.h
Examining data/i3-wm-4.19/include/click.h
Examining data/i3-wm-4.19/include/cmdparse.h
Examining data/i3-wm-4.19/include/commands.h
Examining data/i3-wm-4.19/include/commands_parser.h
Examining data/i3-wm-4.19/include/con.h
Examining data/i3-wm-4.19/include/config_directives.h
Examining data/i3-wm-4.19/include/config_parser.h
Examining data/i3-wm-4.19/include/configuration.h
Examining data/i3-wm-4.19/include/data.h
Examining data/i3-wm-4.19/include/display_version.h
Examining data/i3-wm-4.19/include/drag.h
Examining data/i3-wm-4.19/include/ewmh.h
Examining data/i3-wm-4.19/include/fake_outputs.h
Examining data/i3-wm-4.19/include/floating.h
Examining data/i3-wm-4.19/include/handlers.h
Examining data/i3-wm-4.19/include/i3/ipc.h
Examining data/i3-wm-4.19/include/i3-atoms_NET_SUPPORTED.xmacro.h
Examining data/i3-wm-4.19/include/i3-atoms_rest.xmacro.h
Examining data/i3-wm-4.19/include/i3.h
Examining data/i3-wm-4.19/include/ipc.h
Examining data/i3-wm-4.19/include/key_press.h
Examining data/i3-wm-4.19/include/libi3.h
Examining data/i3-wm-4.19/include/load_layout.h
Examining data/i3-wm-4.19/include/log.h
Examining data/i3-wm-4.19/include/main.h
Examining data/i3-wm-4.19/include/manage.h
Examining data/i3-wm-4.19/include/match.h
Examining data/i3-wm-4.19/include/move.h
Examining data/i3-wm-4.19/include/output.h
Examining data/i3-wm-4.19/include/queue.h
Examining data/i3-wm-4.19/include/randr.h
Examining data/i3-wm-4.19/include/regex.h
Examining data/i3-wm-4.19/include/render.h
Examining data/i3-wm-4.19/include/resize.h
Examining data/i3-wm-4.19/include/restore_layout.h
Examining data/i3-wm-4.19/include/scratchpad.h
Examining data/i3-wm-4.19/include/sd-daemon.h
Examining data/i3-wm-4.19/include/shmlog.h
Examining data/i3-wm-4.19/include/sighandler.h
Examining data/i3-wm-4.19/include/startup.h
Examining data/i3-wm-4.19/include/sync.h
Examining data/i3-wm-4.19/include/tree.h
Examining data/i3-wm-4.19/include/util.h
Examining data/i3-wm-4.19/include/window.h
Examining data/i3-wm-4.19/include/workspace.h
Examining data/i3-wm-4.19/include/x.h
Examining data/i3-wm-4.19/include/xcb.h
Examining data/i3-wm-4.19/include/xcursor.h
Examining data/i3-wm-4.19/include/xinerama.h
Examining data/i3-wm-4.19/include/yajl_utils.h
Examining data/i3-wm-4.19/libi3/dpi.c
Examining data/i3-wm-4.19/libi3/draw_util.c
Examining data/i3-wm-4.19/libi3/fake_configure_notify.c
Examining data/i3-wm-4.19/libi3/font.c
Examining data/i3-wm-4.19/libi3/format_placeholders.c
Examining data/i3-wm-4.19/libi3/g_utf8_make_valid.c
Examining data/i3-wm-4.19/libi3/get_colorpixel.c
Examining data/i3-wm-4.19/libi3/get_config_path.c
Examining data/i3-wm-4.19/libi3/get_exe_path.c
Examining data/i3-wm-4.19/libi3/get_mod_mask.c
Examining data/i3-wm-4.19/libi3/get_process_filename.c
Examining data/i3-wm-4.19/libi3/get_visualtype.c
Examining data/i3-wm-4.19/libi3/ipc_connect.c
Examining data/i3-wm-4.19/libi3/ipc_recv_message.c
Examining data/i3-wm-4.19/libi3/ipc_send_message.c
Examining data/i3-wm-4.19/libi3/is_debug_build.c
Examining data/i3-wm-4.19/libi3/mkdirp.c
Examining data/i3-wm-4.19/libi3/resolve_tilde.c
Examining data/i3-wm-4.19/libi3/root_atom_contents.c
Examining data/i3-wm-4.19/libi3/safewrappers.c
Examining data/i3-wm-4.19/libi3/string.c
Examining data/i3-wm-4.19/libi3/strndup.c
Examining data/i3-wm-4.19/libi3/ucs2_conversion.c
Examining data/i3-wm-4.19/src/assignments.c
Examining data/i3-wm-4.19/src/bindings.c
Examining data/i3-wm-4.19/src/click.c
Examining data/i3-wm-4.19/src/commands.c
Examining data/i3-wm-4.19/src/commands_parser.c
Examining data/i3-wm-4.19/src/con.c
Examining data/i3-wm-4.19/src/config.c
Examining data/i3-wm-4.19/src/config_directives.c
Examining data/i3-wm-4.19/src/config_parser.c
Examining data/i3-wm-4.19/src/display_version.c
Examining data/i3-wm-4.19/src/drag.c
Examining data/i3-wm-4.19/src/ewmh.c
Examining data/i3-wm-4.19/src/fake_outputs.c
Examining data/i3-wm-4.19/src/floating.c
Examining data/i3-wm-4.19/src/handlers.c
Examining data/i3-wm-4.19/src/ipc.c
Examining data/i3-wm-4.19/src/key_press.c
Examining data/i3-wm-4.19/src/load_layout.c
Examining data/i3-wm-4.19/src/log.c
Examining data/i3-wm-4.19/src/main.c
Examining data/i3-wm-4.19/src/manage.c
Examining data/i3-wm-4.19/src/match.c
Examining data/i3-wm-4.19/src/move.c
Examining data/i3-wm-4.19/src/output.c
Examining data/i3-wm-4.19/src/randr.c
Examining data/i3-wm-4.19/src/regex.c
Examining data/i3-wm-4.19/src/render.c
Examining data/i3-wm-4.19/src/resize.c
Examining data/i3-wm-4.19/src/restore_layout.c
Examining data/i3-wm-4.19/src/scratchpad.c
Examining data/i3-wm-4.19/src/sd-daemon.c
Examining data/i3-wm-4.19/src/sighandler.c
Examining data/i3-wm-4.19/src/startup.c
Examining data/i3-wm-4.19/src/sync.c
Examining data/i3-wm-4.19/src/tree.c
Examining data/i3-wm-4.19/src/util.c
Examining data/i3-wm-4.19/src/version.c
Examining data/i3-wm-4.19/src/window.c
Examining data/i3-wm-4.19/src/workspace.c
Examining data/i3-wm-4.19/src/x.c
Examining data/i3-wm-4.19/src/xcb.c
Examining data/i3-wm-4.19/src/xcursor.c
Examining data/i3-wm-4.19/src/xinerama.c
Examining data/i3-wm-4.19/testcases/inject_randr1.5.c

FINAL RESULTS:

data/i3-wm-4.19/libi3/get_exe_path.c:37:24:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    while ((linksize = readlink(exepath, destpath, destpath_size)) == (ssize_t)destpath_size) {
data/i3-wm-4.19/src/display_version.c:123:24:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    while ((linksize = readlink(exepath, destpath, destpath_size)) == (ssize_t)destpath_size) {
data/i3-wm-4.19/src/display_version.c:139:24:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    while ((linksize = readlink(exepath, destpath, destpath_size)) == (ssize_t)destpath_size) {
data/i3-wm-4.19/src/util.c:165:9:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    if (readlink("/proc/self/exe", buffer, BUFSIZ) == -1) {
data/i3-wm-4.19/i3-config-wizard/main.c:456:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, fmt, args);
data/i3-wm-4.19/i3-config-wizard/main.c:464:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/i3-dump-log/main.c:85:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/i3-input/main.c:71:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, fmt, args);
data/i3-wm-4.19/i3-input/main.c:79:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/i3-input/main.c:101:13:  [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((char *)walk, glyphs[c]);
data/i3-wm-4.19/i3-input/main.c:402:17:  [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.
                printf("i3-input " I3_VERSION);
data/i3-wm-4.19/i3-msg/main.c:39:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, fmt, args);
data/i3-wm-4.19/i3-msg/main.c:47:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/i3-nagbar/main.c:92:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/i3-nagbar/main.c:100:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/i3-nagbar/main.c:120:13:  [4] (shell) execl:
  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.
            execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, NULL);
data/i3-wm-4.19/i3-nagbar/main.c:357:9:  [4] (shell) execl:
  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.
        execl(_PATH_BSHELL, _PATH_BSHELL, cmd, NULL);
data/i3-wm-4.19/i3bar/include/util.h:58:13:  [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.
            printf("[%s:%d] " fmt, __FILE__, __LINE__, ##__VA_ARGS__); \
data/i3-wm-4.19/i3bar/include/util.h:69:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, "[%s:%d] ERROR: " fmt, __FILE__, __LINE__, ##__VA_ARGS__); \
data/i3-wm-4.19/i3bar/src/child.c:104:23:  [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))) static void set_statusline_error(const char *format, ...) {
data/i3-wm-4.19/i3bar/src/child.c:593:13:  [4] (shell) execl:
  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.
            execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (char *)NULL);
data/i3-wm-4.19/i3bar/src/main.c:28:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, fmt, args);
data/i3-wm-4.19/i3bar/src/main.c:36:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/include/libi3.h:93: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/i3-wm-4.19/include/libi3.h:98: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/i3-wm-4.19/include/libi3.h:103: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/i3-wm-4.19/include/log.h:80: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/i3-wm-4.19/include/log.h:87: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/i3-wm-4.19/include/log.h:95: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/i3-wm-4.19/include/sd-daemon.h:71:54:  [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 _sd_printf_attr_(a, b) __attribute__((format(printf, a, b)))
data/i3-wm-4.19/libi3/format_placeholders.c:55:24:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            outwalk += sprintf(outwalk, "%s", placeholders[i].value);
data/i3-wm-4.19/libi3/get_exe_path.c:93:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        if (access(destpath, X_OK) == 0) {
data/i3-wm-4.19/libi3/resolve_tilde.c:38:9:  [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(result, head);
data/i3-wm-4.19/libi3/resolve_tilde.c:40:13:  [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(result, tail);
data/i3-wm-4.19/src/commands_parser.c:386:21:  [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(tokenwalk, token->name + 1);
data/i3-wm-4.19/src/commands_parser.c:393:21:  [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(tokenwalk, token->name);
data/i3-wm-4.19/src/commands_parser.c:479:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, fmt, args);
data/i3-wm-4.19/src/commands_parser.c:487:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/src/config_parser.c:447:21:  [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(tokenwalk, token->name + 1);
data/i3-wm-4.19/src/config_parser.c:458:21:  [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(tokenwalk, token->name);
data/i3-wm-4.19/src/config_parser.c:585:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, fmt, args);
data/i3-wm-4.19/src/config_parser.c:593:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, args);
data/i3-wm-4.19/src/log.c:254:9:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        vprintf(fmt, args);
data/i3-wm-4.19/src/log.c:256:16:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        len += vsnprintf(message + len, sizeof(message) - len, fmt, args);
data/i3-wm-4.19/src/log.c:325:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(errorfile, fmt, args);
data/i3-wm-4.19/src/sighandler.c:113:9:  [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(args[0], args);
data/i3-wm-4.19/src/startup.c:195:13:  [4] (shell) execl:
  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.
            execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, NULL);
data/i3-wm-4.19/src/util.c:151:5:  [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(migratepath, argv);
data/i3-wm-4.19/src/util.c:160:5:  [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(migratepath, argv);
data/i3-wm-4.19/src/util.c:172:5:  [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(migratepath, argv);
data/i3-wm-4.19/src/util.c:311:5:  [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(start_argv[0], start_argv);
data/i3-wm-4.19/testcases/inject_randr1.5.c:465:9:  [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(child_args[0], child_args);
data/i3-wm-4.19/i3-config-wizard/main.c:763:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
data/i3-wm-4.19/i3-config-wizard/main.c:796: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.
    if ((xdg_config_home = getenv("XDG_CONFIG_HOME")) == NULL)
data/i3-wm-4.19/i3-dump-log/main.c:112:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
data/i3-wm-4.19/i3-dump-log/main.c:143:17:  [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("DISPLAY") == NULL) {
data/i3-wm-4.19/i3-dump-log/main.c:149:90:  [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.
            fprintf(stderr, "FYI: The DISPLAY environment variable is set to \"%s\".\n", getenv("DISPLAY"));
data/i3-wm-4.19/i3-input/main.c:395:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
data/i3-wm-4.19/i3-msg/main.c:171:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
data/i3-wm-4.19/i3-nagbar/main.c:382:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
data/i3-wm-4.19/i3bar/src/main.c:111:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, "b:s:thvV", long_opt, &option_index)) != -1) {
data/i3-wm-4.19/i3bar/src/main.c:148:23:  [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.
        socket_path = getenv("I3SOCK");
data/i3-wm-4.19/libi3/get_config_path.c:46: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.
    if ((xdg_config_home = getenv("XDG_CONFIG_HOME")) == NULL) {
data/i3-wm-4.19/libi3/get_config_path.c:73: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.
    if ((xdg_config_dirs = getenv("XDG_CONFIG_DIRS")) == NULL) {
data/i3-wm-4.19/libi3/get_exe_path.c:72:18:  [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.
    char *path = getenv("PATH");
data/i3-wm-4.19/libi3/get_process_filename.c:26: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.
        if ((dir = getenv("XDG_RUNTIME_DIR"))) {
data/i3-wm-4.19/libi3/get_process_filename.c:35: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.
                         getenv("XDG_RUNTIME_DIR"));
data/i3-wm-4.19/libi3/ipc_connect.c:29: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.
        if ((path = getenv("I3SOCK")) != NULL) {
data/i3-wm-4.19/src/display_version.c:54: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("DISPLAY") == NULL) {
data/i3-wm-4.19/src/main.c:257:30:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    const char *restart_fd = getenv("_I3_RESTART_FD");
data/i3-wm-4.19/src/main.c:317:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand(time(NULL));
data/i3-wm-4.19/src/main.c:328:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, "c:CvmaL:hld:V", long_options, &option_index)) != -1) {
data/i3-wm-4.19/src/main.c:631:39:  [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 ((config.ipc_socket_path = getenv("I3SOCK")) == NULL)
data/i3-wm-4.19/src/sd-daemon.c:53:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (!(e = getenv("LISTEN_PID"))) {
data/i3-wm-4.19/src/sd-daemon.c:77:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (!(e = getenv("LISTEN_FDS"))) {
data/i3-wm-4.19/src/sd-daemon.c:334:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (!(e = getenv("NOTIFY_SOCKET")))
data/i3-wm-4.19/src/sighandler.c:50: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.
    char *tmpdir = getenv("TMPDIR");
data/i3-wm-4.19/testcases/inject_randr1.5.c:161: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 (xcb_parse_display(getenv("DISPLAY"), &host, &displayp, NULL) == 0) {
data/i3-wm-4.19/testcases/inject_randr1.5.c:162:58:  [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.
        errx(EXIT_FAILURE, "Could not parse DISPLAY=%s", getenv("DISPLAY"));
data/i3-wm-4.19/testcases/inject_randr1.5.c:390:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
data/i3-wm-4.19/i3-config-wizard/main.c:252:23:  [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).
        int keycode = atoi(get_string("key"));
data/i3-wm-4.19/i3-config-wizard/main.c:285: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 str[4096];
data/i3-wm-4.19/i3-config-wizard/main.c:654: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 *kc_config = fopen(SYSCONFDIR "/i3/config.keycodes", "r");
data/i3-wm-4.19/i3-config-wizard/main.c:658: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 *ks_config = fopen(config_path, "w");
data/i3-wm-4.19/i3-config-wizard/main.c:813:15:  [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).
    if ((fd = open(config_path, O_CREAT | O_RDWR, 0644)) == -1) {
data/i3-wm-4.19/i3-input/main.c:53: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 *glyphs_utf8[512];
data/i3-wm-4.19/i3-input/main.c:98: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(walk, glyphs[c], 2);
data/i3-wm-4.19/i3-input/main.c:101:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            strcpy((char *)walk, glyphs[c]);
data/i3-wm-4.19/i3-input/main.c:411:25:  [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).
                limit = atoi(optarg);
data/i3-wm-4.19/i3-nagbar/main.c:167: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(script_path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
data/i3-wm-4.19/i3bar/src/child.c:93: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(new_block, current, sizeof(struct status_block));
data/i3-wm-4.19/i3bar/src/child.c:311: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(new_block, &(ctx->block), sizeof(struct status_block));
data/i3-wm-4.19/i3bar/src/ipc.c:253: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(&size, (uint32_t *)walk, sizeof(uint32_t));
data/i3-wm-4.19/i3bar/src/ipc.c:256: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(&type, (uint32_t *)walk, sizeof(uint32_t));
data/i3-wm-4.19/i3bar/src/ipc.c:309: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(buffer, I3_IPC_MAGIC, strlen(I3_IPC_MAGIC));
data/i3-wm-4.19/i3bar/src/ipc.c:311: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(walk, &len, sizeof(uint32_t));
data/i3-wm-4.19/i3bar/src/ipc.c:313: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(walk, &type, sizeof(uint32_t));
data/i3-wm-4.19/i3bar/src/workspaces.c:115:20:  [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 ws_num[32];
data/i3-wm-4.19/i3bar/src/xcb.c:640: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(buffer, "workspace \"", strlen("workspace \""));
data/i3-wm-4.19/i3bar/src/xcb.c:1403: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 atomname[strlen("_NET_SYSTEM_TRAY_S") + 11];
data/i3-wm-4.19/i3bar/src/xcb.c:1496: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 strgroups[3][3] = {{bar_fg[1], bar_fg[2], '\0'},
data/i3-wm-4.19/include/i3/ipc.h:17: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 magic[6];
data/i3-wm-4.19/libi3/draw_util.c:91: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 alpha[2];
data/i3-wm-4.19/libi3/draw_util.c:99: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 groups[4][3] = {
data/i3-wm-4.19/libi3/format_placeholders.c:40: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[buffer_len];
data/i3-wm-4.19/libi3/get_colorpixel.c:15: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 hex[8];
data/i3-wm-4.19/libi3/get_colorpixel.c:33: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 strgroups[3][3] = {
data/i3-wm-4.19/libi3/ipc_recv_message.c:33: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 msg[to_read];
data/i3-wm-4.19/libi3/ipc_recv_message.c:61: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(reply_length, walk, sizeof(uint32_t));
data/i3-wm-4.19/libi3/ipc_recv_message.c:64: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(message_type, walk, sizeof(uint32_t));
data/i3-wm-4.19/libi3/string.c:90: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(str->ucs2, from_ucs2, num_glyphs * sizeof(xcb_char2b_t));
data/i3-wm-4.19/libi3/strndup.c:27: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(copy, str, len);
data/i3-wm-4.19/src/bindings.c:1026: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(buttons, buffer, num * sizeof(int));
data/i3-wm-4.19/src/config_directives.c:534:22:  [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).
    int input_code = atoi(button + strlen("button"));
data/i3-wm-4.19/src/config_parser.c:891: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[4096], key[512], value[4096], *continuation = NULL;
data/i3-wm-4.19/src/config_parser.c:893:15:  [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).
    if ((fd = open(f, O_RDONLY)) == -1)
data/i3-wm-4.19/src/config_parser.c:948: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 v_key[512];
data/i3-wm-4.19/src/config_parser.c:949: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 v_value[4096] = {'\0'};
data/i3-wm-4.19/src/config_parser.c:966: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 res_name[512] = {'\0'};
data/i3-wm-4.19/src/config_parser.c:967: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 v_key[512];
data/i3-wm-4.19/src/config_parser.c:968: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 fallback[4096] = {'\0'};
data/i3-wm-4.19/src/display_version.c:103: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 mtime[64];
data/i3-wm-4.19/src/display_version.c:161:15:  [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).
    if ((fd = open(exepath, O_RDONLY)) == -1)
data/i3-wm-4.19/src/ewmh.c:75: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 desktop_names[msg_length];
data/i3-wm-4.19/src/ipc.c:124: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(client->buffer + client->buffer_size, ((void *)&header), header_size);
data/i3-wm-4.19/src/ipc.c:125: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(client->buffer + client->buffer_size + header_size, payload, size);
data/i3-wm-4.19/src/ipc.c:1167: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(client->events[event], s, len);
data/i3-wm-4.19/src/ipc.c:1290: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(state->last_key, val, len);
data/i3-wm-4.19/src/ipc.c:1433: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(exepath, O_RDONLY);
data/i3-wm-4.19/src/ipc.c:1438: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[512] = {'\0'}; /* cut off cmdline for the error message. */
data/i3-wm-4.19/src/load_layout.c:244: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(last_key, val, len);
data/i3-wm-4.19/src/load_layout.c:302: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(json_node->name, val, len);
data/i3-wm-4.19/src/load_layout.c:305: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(json_node->title_format, val, len);
data/i3-wm-4.19/src/load_layout.c:308: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(json_node->sticky_group, val, len);
data/i3-wm-4.19/src/log.c:87:25:  [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).
            errorfile = fopen(errorfilename, "w");
data/i3-wm-4.19/src/log.c:225: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 message[4096];
data/i3-wm-4.19/src/main.c:399:35:  [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).
                    shmlog_size = atoi(optarg);
data/i3-wm-4.19/src/main.c:545:26:  [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).
        if ((patternfd = open("/proc/sys/kernel/core_pattern", O_RDONLY)) >= 0) {
data/i3-wm-4.19/src/match.c:63: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, src, sizeof(Match));
data/i3-wm-4.19/src/util.c:164: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[BUFSIZ];
data/i3-wm-4.19/src/util.c:257: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(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
data/i3-wm-4.19/src/util.c:438:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((f = fopen(path, "r")) == NULL) {
data/i3-wm-4.19/src/x.c:249: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(&(state_dest->window_rect), &(state_src->window_rect), sizeof(Rect));
data/i3-wm-4.19/src/x.c:1000: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(&(state->rect), &rect, sizeof(Rect));
data/i3-wm-4.19/src/x.c:1010: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(&(state->window_rect), &(con->window_rect), sizeof(Rect));
data/i3-wm-4.19/src/x.c:1202: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(walk++, &(state->con->window->id), sizeof(xcb_window_t));
data/i3-wm-4.19/testcases/inject_randr1.5.c:364:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((f = fopen(filename, "r")) == NULL) {
data/i3-wm-4.19/i3-config-wizard/main.c:322:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const size_t len = strlen(input);
data/i3-wm-4.19/i3-config-wizard/main.c:343:56:  [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 (strncasecmp(walk, token->name + 1, strlen(token->name) - 1) == 0) {
data/i3-wm-4.19/i3-config-wizard/main.c:346: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).
                    walk += strlen(token->name) - 1;
data/i3-wm-4.19/i3-config-wizard/main.c:566: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("i3: generate config"),
data/i3-wm-4.19/i3-config-wizard/main.c:666:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t read;
data/i3-wm-4.19/i3-config-wizard/main.c:687:15:  [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(line);
data/i3-wm-4.19/i3-config-wizard/main.c:691:40:  [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).
            strncmp("# WARNING", line, strlen("# WARNING")) == 0)
data/i3-wm-4.19/i3-config-wizard/main.c:705:40:  [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 (strncmp(walk, "set $mod ", strlen("set $mod ")) == 0) {
data/i3-wm-4.19/i3-config-wizard/main.c:715:39:  [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 (strncmp(walk, "bindcode", strlen("bindcode")) != 0) {
data/i3-wm-4.19/i3-config-wizard/main.c:737: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).
    ipc_send_message(sockfd, strlen("reload"), 0, (uint8_t *)"reload");
data/i3-wm-4.19/i3-config-wizard/main.c:847:71:  [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).
    xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
data/i3-wm-4.19/i3-config-wizard/main.c:925: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).
                        strlen("i3: first configuration"),
data/i3-wm-4.19/i3-config-wizard/main.c:944:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(1000);
data/i3-wm-4.19/i3-dump-log/main.c:47: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 (ipc_send_message(ipcfd, strlen(disablecmd),
data/i3-wm-4.19/i3-dump-log/main.c:156: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).
            if (ipc_send_message(ipcfd, strlen(enablecmd),
data/i3-wm-4.19/i3-input/main.c:102:21:  [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).
            walk += strlen(glyphs[c]);
data/i3-wm-4.19/i3-input/main.c:167:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int len = strlen(format);
data/i3-wm-4.19/i3-input/main.c:175:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int inputlen = strlen(command);
data/i3-wm-4.19/i3-input/main.c:176: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).
    char *full = scalloc(strlen(format) - (2 * cnt) /* format without all %s */
data/i3-wm-4.19/i3-input/main.c:187:13:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
            strncat(dest, command, inputlen);
data/i3-wm-4.19/i3-input/main.c:197:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int ret = ipc_send_message(sockfd, strlen(full), 0, (uint8_t *)full);
data/i3-wm-4.19/i3-input/main.c:304:69:  [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).
    xcb_intern_atom_cookie_t nswc_cookie = xcb_intern_atom(conn, 0, strlen("_NET_SUPPORTING_WM_CHECK"), "_NET_SUPPORTING_WM_CHECK");
data/i3-wm-4.19/i3-input/main.c:497:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(1000);
data/i3-wm-4.19/i3-msg/main.c:247:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (ipc_send_message(sockfd, strlen(payload), message_type, (uint8_t *)payload) == -1)
data/i3-wm-4.19/i3-nagbar/main.c:351: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).
    const size_t argv0_len = strlen(argv[0]);
data/i3-wm-4.19/i3-nagbar/main.c:352:21:  [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 (argv0_len > strlen(".nagbar_cmd") &&
data/i3-wm-4.19/i3-nagbar/main.c:353: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).
        strcmp(argv[0] + argv0_len - strlen(".nagbar_cmd"), ".nagbar_cmd") == 0) {
data/i3-wm-4.19/i3-nagbar/main.c:356: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).
        *(cmd + argv0_len - strlen(".nagbar_cmd")) = '\0';
data/i3-wm-4.19/i3-nagbar/main.c:430:71:  [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).
    xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
data/i3-wm-4.19/i3bar/include/util.h:20: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).
#define STARTS_WITH(string, len, needle) (((len) >= strlen((needle))) && strncasecmp((string), (needle), strlen((needle))) == 0)
data/i3-wm-4.19/i3bar/include/util.h:20:106:  [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 STARTS_WITH(string, len, needle) (((len) >= strlen((needle))) && strncasecmp((string), (needle), strlen((needle))) == 0)
data/i3-wm-4.19/i3bar/src/child.c:240: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).
        ctx->block.pango_markup = (len == strlen("pango") && !strncasecmp((const char *)val, "pango", strlen("pango")));
data/i3-wm-4.19/i3bar/src/child.c:240:103:  [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).
        ctx->block.pango_markup = (len == strlen("pango") && !strncasecmp((const char *)val, "pango", strlen("pango")));
data/i3-wm-4.19/i3bar/src/child.c:244:20:  [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 (len == strlen("center") && !strncmp((const char *)val, "center", strlen("center"))) {
data/i3-wm-4.19/i3bar/src/child.c:244:78:  [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 (len == strlen("center") && !strncmp((const char *)val, "center", strlen("center"))) {
data/i3-wm-4.19/i3bar/src/child.c:246: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).
        } else if (len == strlen("right") && !strncmp((const char *)val, "right", strlen("right"))) {
data/i3-wm-4.19/i3bar/src/child.c:246:83:  [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 (len == strlen("right") && !strncmp((const char *)val, "right", strlen("right"))) {
data/i3-wm-4.19/i3bar/src/child.c:369:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        n = read(fd, buffer + rec, buffer_len - rec);
data/i3-wm-4.19/i3bar/src/child.c:422:21:  [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 (message[strlen(message) - 1] == '\n')
data/i3-wm-4.19/i3bar/src/child.c:423:21:  [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).
            message[strlen(message) - 1] = '\0';
data/i3-wm-4.19/i3bar/src/config.c:108: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).
        config.hide_on_modifier = (len == strlen("dock") && !strncmp((const char *)val, "dock", strlen("dock")) ? M_DOCK
data/i3-wm-4.19/i3bar/src/config.c:108:97:  [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).
        config.hide_on_modifier = (len == strlen("dock") && !strncmp((const char *)val, "dock", strlen("dock")) ? M_DOCK
data/i3-wm-4.19/i3bar/src/config.c:109:123:  [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("hide") && !strncmp((const char *)val, "hide", strlen("hide")) ? M_HIDE
data/i3-wm-4.19/i3bar/src/config.c:109:177:  [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("hide") && !strncmp((const char *)val, "hide", strlen("hide")) ? M_HIDE
data/i3-wm-4.19/i3bar/src/config.c:116:39:  [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).
        config.hidden_state = (len == strlen("hide") && !strncmp((const char *)val, "hide", strlen("hide")) ? S_HIDE : S_SHOW);
data/i3-wm-4.19/i3bar/src/config.c:116:93:  [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).
        config.hidden_state = (len == strlen("hide") && !strncmp((const char *)val, "hide", strlen("hide")) ? S_HIDE : S_SHOW);
data/i3-wm-4.19/i3bar/src/config.c:123:20:  [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 (len == strlen("none") && !strncmp((const char *)val, "none", strlen("none"))) {
data/i3-wm-4.19/i3bar/src/config.c:123:74:  [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 (len == strlen("none") && !strncmp((const char *)val, "none", strlen("none"))) {
data/i3-wm-4.19/i3bar/src/config.c:128:20:  [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 (len == strlen("shift") && !strncmp((const char *)val, "shift", strlen("shift"))) {
data/i3-wm-4.19/i3bar/src/config.c:128:76:  [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 (len == strlen("shift") && !strncmp((const char *)val, "shift", strlen("shift"))) {
data/i3-wm-4.19/i3bar/src/config.c:132:20:  [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 (len == strlen("ctrl") && !strncmp((const char *)val, "ctrl", strlen("ctrl"))) {
data/i3-wm-4.19/i3bar/src/config.c:132:74:  [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 (len == strlen("ctrl") && !strncmp((const char *)val, "ctrl", strlen("ctrl"))) {
data/i3-wm-4.19/i3bar/src/config.c:136:20:  [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 (len == strlen("Mod") + 1 && !strncmp((const char *)val, "Mod", strlen("Mod"))) {
data/i3-wm-4.19/i3bar/src/config.c:136:76:  [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 (len == strlen("Mod") + 1 && !strncmp((const char *)val, "Mod", strlen("Mod"))) {
data/i3-wm-4.19/i3bar/src/config.c:181:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        config.position = (len == strlen("top") && !strncmp((const char *)val, "top", strlen("top")) ? POS_TOP : POS_BOT);
data/i3-wm-4.19/i3bar/src/config.c:181: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).
        config.position = (len == strlen("top") && !strncmp((const char *)val, "top", strlen("top")) ? POS_TOP : POS_BOT);
data/i3-wm-4.19/i3bar/src/config.c:377:61:  [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).
    state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
data/i3-wm-4.19/i3bar/src/ipc.c:218: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).
    uint32_t header_len = strlen(I3_IPC_MAGIC) + sizeof(uint32_t) * 2;
data/i3-wm-4.19/i3bar/src/ipc.c:225:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int n = read(fd, header + rec, header_len - rec);
data/i3-wm-4.19/i3bar/src/ipc.c:243:39:  [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 (strncmp(header, I3_IPC_MAGIC, strlen(I3_IPC_MAGIC))) {
data/i3-wm-4.19/i3bar/src/ipc.c:245: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).
             (int)strlen(I3_IPC_MAGIC),
data/i3-wm-4.19/i3bar/src/ipc.c:251: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).
    char *walk = header + strlen(I3_IPC_MAGIC);
data/i3-wm-4.19/i3bar/src/ipc.c:264:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int n = read(fd, buffer + rec, size - rec);
data/i3-wm-4.19/i3bar/src/ipc.c:298:15:  [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(payload);
data/i3-wm-4.19/i3bar/src/ipc.c:302: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).
    uint32_t to_write = strlen(I3_IPC_MAGIC) + sizeof(uint32_t) * 2 + len;
data/i3-wm-4.19/i3bar/src/ipc.c:309:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    memcpy(buffer, I3_IPC_MAGIC, strlen(I3_IPC_MAGIC));
data/i3-wm-4.19/i3bar/src/ipc.c:310: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).
    walk += strlen(I3_IPC_MAGIC);
data/i3-wm-4.19/i3bar/src/ipc.c:317:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(walk, payload, len);
data/i3-wm-4.19/i3bar/src/mode.c:118:61:  [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).
    state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
data/i3-wm-4.19/i3bar/src/outputs.c:280:61:  [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).
    state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
data/i3-wm-4.19/i3bar/src/parse_json_header.c:60:39:  [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 CHECK_KEY(name) (stringlen == strlen(name) && \
data/i3-wm-4.19/i3bar/src/workspaces.c:241:61:  [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).
    state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
data/i3-wm-4.19/i3bar/src/xcb.c:638:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const size_t len = namelen + strlen("workspace \"\"") + 1;
data/i3-wm-4.19/i3bar/src/xcb.c:640: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(buffer, "workspace \"", strlen("workspace \""));
data/i3-wm-4.19/i3bar/src/xcb.c:642: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).
    for (inpos = 0, outpos = strlen("workspace \"");
data/i3-wm-4.19/i3bar/src/xcb.c:1255:79:  [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 ATOM_DO(name) atom_cookies[name] = xcb_intern_atom(xcb_connection, 0, strlen(#name), #name);
data/i3-wm-4.19/i3bar/src/xcb.c:1403: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).
    char atomname[strlen("_NET_SYSTEM_TRAY_S") + 11];
data/i3-wm-4.19/i3bar/src/xcb.c:1404:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S%d", screen);
data/i3-wm-4.19/i3bar/src/xcb.c:1407: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).
        tray_cookie = xcb_intern_atom(xcb_connection, 0, strlen(atomname), atomname);
data/i3-wm-4.19/i3bar/src/xcb.c:1825:47:  [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(name),
data/i3-wm-4.19/include/util.h:25:70:  [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 STARTS_WITH(string, needle) (strncasecmp((string), (needle), strlen((needle))) == 0)
data/i3-wm-4.19/include/yajl_utils.h:20:62:  [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 ystr(str) yajl_gen_string(gen, (unsigned char *)str, strlen(str))
data/i3-wm-4.19/libi3/draw_util.c:86: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(color) < 6 || color[0] != '#') {
data/i3-wm-4.19/libi3/draw_util.c:92: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(color) == strlen("#rrggbbaa")) {
data/i3-wm-4.19/libi3/draw_util.c: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).
    if (strlen(color) == strlen("#rrggbbaa")) {
data/i3-wm-4.19/libi3/font.c:173: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(pattern) > strlen("pango:") && !strncmp(pattern, "pango:", strlen("pango:"))) {
data/i3-wm-4.19/libi3/font.c:173: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).
    if (strlen(pattern) > strlen("pango:") && !strncmp(pattern, "pango:", strlen("pango:"))) {
data/i3-wm-4.19/libi3/font.c:173:75:  [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(pattern) > strlen("pango:") && !strncmp(pattern, "pango:", strlen("pango:"))) {
data/i3-wm-4.19/libi3/font.c:174:46:  [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 char *font_pattern = pattern + strlen("pango:");
data/i3-wm-4.19/libi3/font.c:179: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).
    } else if (strlen(pattern) > strlen("xft:") && !strncmp(pattern, "xft:", strlen("xft:"))) {
data/i3-wm-4.19/libi3/font.c:179:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    } else if (strlen(pattern) > strlen("xft:") && !strncmp(pattern, "xft:", strlen("xft:"))) {
data/i3-wm-4.19/libi3/font.c:179:78:  [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(pattern) > strlen("xft:") && !strncmp(pattern, "xft:", strlen("xft:"))) {
data/i3-wm-4.19/libi3/font.c:180:46:  [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 char *font_pattern = pattern + strlen("xft:");
data/i3-wm-4.19/libi3/font.c:190: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).
                                                          strlen(pattern), pattern);
data/i3-wm-4.19/libi3/font.c:203: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).
                                            strlen(pattern), pattern);
data/i3-wm-4.19/libi3/font.c:215:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                                                strlen(pattern), pattern);
data/i3-wm-4.19/libi3/font.c:396: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).
            size_t text_len = strlen(text);
data/i3-wm-4.19/libi3/font.c:412:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            draw_text_pango(text, strlen(text),
data/i3-wm-4.19/libi3/format_placeholders.c:14:69:  [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 CS_STARTS_WITH(string, needle) (strncmp((string), (needle), strlen((needle))) == 0)
data/i3-wm-4.19/libi3/format_placeholders.c:27: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).
    int buffer_len = strlen(format) + 1;
data/i3-wm-4.19/libi3/format_placeholders.c:33:39:  [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).
            buffer_len = buffer_len - strlen(placeholders[i].name) + strlen(placeholders[i].value);
data/i3-wm-4.19/libi3/format_placeholders.c:33:70:  [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).
            buffer_len = buffer_len - strlen(placeholders[i].name) + strlen(placeholders[i].value);
data/i3-wm-4.19/libi3/format_placeholders.c:34:21:  [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).
            walk += strlen(placeholders[i].name) - 1;
data/i3-wm-4.19/libi3/format_placeholders.c:56:21:  [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).
            walk += strlen(placeholders[i].name) - 1;
data/i3-wm-4.19/libi3/g_utf8_make_valid.c:60:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen (str);
data/i3-wm-4.19/libi3/get_colorpixel.c:74:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(cache_pixel->hex, hex, 7);
data/i3-wm-4.19/libi3/ipc_connect.c:51:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(addr.sun_path, path, sizeof(addr.sun_path) - 1);
data/i3-wm-4.19/libi3/ipc_recv_message.c:32: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).
    const uint32_t to_read = strlen(I3_IPC_MAGIC) + sizeof(uint32_t) + sizeof(uint32_t);
data/i3-wm-4.19/libi3/ipc_recv_message.c:38:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int n = read(sockfd, msg + read_bytes, to_read - read_bytes);
data/i3-wm-4.19/libi3/ipc_recv_message.c:54: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).
    if (memcmp(walk, I3_IPC_MAGIC, strlen(I3_IPC_MAGIC)) != 0) {
data/i3-wm-4.19/libi3/ipc_recv_message.c:56: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).
             (int)strlen(I3_IPC_MAGIC), walk, I3_IPC_MAGIC);
data/i3-wm-4.19/libi3/ipc_recv_message.c:60: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).
    walk += strlen(I3_IPC_MAGIC);
data/i3-wm-4.19/libi3/ipc_recv_message.c:70:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        const int n = read(sockfd, *reply + read_bytes, *reply_length - read_bytes);
data/i3-wm-4.19/libi3/mkdirp.c:41: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).
    while (copy[strlen(copy) - 1] == '/')
data/i3-wm-4.19/libi3/mkdirp.c:42:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        copy[strlen(copy) - 1] = '\0';
data/i3-wm-4.19/libi3/resolve_tilde.c:26: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).
    head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path));
data/i3-wm-4.19/libi3/resolve_tilde.c:37: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).
        result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1);
data/i3-wm-4.19/libi3/resolve_tilde.c:37:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1);
data/i3-wm-4.19/libi3/root_atom_contents.c:41:44:  [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).
    atom_cookie = xcb_intern_atom(conn, 0, strlen(atomname), atomname);
data/i3-wm-4.19/libi3/string.c:61: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).
    str->num_bytes = num_bytes < 0 ? strlen(str->utf8) : (size_t)num_bytes;
data/i3-wm-4.19/libi3/string.c:127: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).
        str->num_bytes = strlen(str->utf8);
data/i3-wm-4.19/libi3/ucs2_conversion.c:64: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 input_size = strlen(input);
data/i3-wm-4.19/src/bindings.c:866:40:  [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).
        conn, xcb_intern_atom(conn, 0, strlen("_XKB_RULES_NAMES"), "_XKB_RULES_NAMES"), NULL);
data/i3-wm-4.19/src/commands.c:19:111:  [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 ystr(str) (cmd_output->json_gen != NULL ? yajl_gen_string(cmd_output->json_gen, (unsigned char *)str, strlen(str)) : 0)
data/i3-wm-4.19/src/commands.c:351: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 (strncasecmp(name, "__", strlen("__")) == 0) {
data/i3-wm-4.19/src/commands.c:940: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 (strncasecmp(name, "__", strlen("__")) == 0) {
data/i3-wm-4.19/src/commands.c:1982:37:  [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 (strncasecmp(new_name, "__", strlen("__")) == 0) {
data/i3-wm-4.19/src/commands_parser.c:30:117:  [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 ystr(str) (command_output.json_gen != NULL ? yajl_gen_string(command_output.json_gen, (unsigned char *)str, strlen(str)) : 0)
data/i3-wm-4.19/src/commands_parser.c:272:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const size_t len = strlen(input);
data/i3-wm-4.19/src/commands_parser.c:298:56:  [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 (strncasecmp(walk, token->name + 1, strlen(token->name) - 1) == 0) {
data/i3-wm-4.19/src/commands_parser.c:301: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).
                    walk += strlen(token->name) - 1;
data/i3-wm-4.19/src/commands_parser.c:372: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).
                tokenlen += strlen(ptr->array[c].name) + strlen("'', ");
data/i3-wm-4.19/src/commands_parser.c:372: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).
                tokenlen += strlen(ptr->array[c].name) + strlen("'', ");
data/i3-wm-4.19/src/commands_parser.c:387:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    tokenwalk += strlen(token->name + 1);
data/i3-wm-4.19/src/commands_parser.c:394:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    tokenwalk += strlen(token->name);
data/i3-wm-4.19/src/config_directives.c:529:39:  [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 (strncasecmp(button, "button", strlen("button")) != 0) {
data/i3-wm-4.19/src/config_directives.c:534: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).
    int input_code = atoi(button + strlen("button"));
data/i3-wm-4.19/src/config_parser.c:43:82:  [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 ystr(str) yajl_gen_string(command_output.json_gen, (unsigned char *)str, strlen(str))
data/i3-wm-4.19/src/config_parser.c:285:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const size_t len = strlen(input);
data/i3-wm-4.19/src/config_parser.c:313:56:  [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 (strncasecmp(walk, token->name + 1, strlen(token->name) - 1) == 0) {
data/i3-wm-4.19/src/config_parser.c:316: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).
                    walk += strlen(token->name) - 1;
data/i3-wm-4.19/src/config_parser.c:433: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).
                tokenlen += strlen(ptr->array[c].name) + strlen("'', ");
data/i3-wm-4.19/src/config_parser.c:433: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).
                tokenlen += strlen(ptr->array[c].name) + strlen("'', ");
data/i3-wm-4.19/src/config_parser.c:448:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    tokenwalk += strlen(token->name + 1);
data/i3-wm-4.19/src/config_parser.c:459:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    tokenwalk += strlen(token->name);
data/i3-wm-4.19/src/config_parser.c:477: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).
            char *position = scalloc(strlen(error_line) + 1, 1);
data/i3-wm-4.19/src/config_parser.c:638: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).
        if (strncasecmp(line, "bindcode", strlen("bindcode")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:639:55:  [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).
            strncasecmp(line, "force_focus_wrapping", strlen("force_focus_wrapping")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:640:56:  [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).
            strncasecmp(line, "# i3 config file (v4)", strlen("# i3 config file (v4)")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:641:51:  [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).
            strncasecmp(line, "workspace_layout", strlen("workspace_layout")) == 0) {
data/i3-wm-4.19/src/config_parser.c:647:39:  [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 (strncasecmp(line, "bind", strlen("bind")) == 0) {
data/i3-wm-4.19/src/config_parser.c:661: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).
            if (strncasecmp(bind, "layout", strlen("layout")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:662:47:  [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).
                strncasecmp(bind, "floating", strlen("floating")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:663: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).
                strncasecmp(bind, "workspace", strlen("workspace")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:664:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                strncasecmp(bind, "focus left", strlen("focus left")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:665:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                strncasecmp(bind, "focus right", strlen("focus right")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:666:47:  [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).
                strncasecmp(bind, "focus up", strlen("focus up")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:667:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                strncasecmp(bind, "focus down", strlen("focus down")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:668:52:  [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).
                strncasecmp(bind, "border normal", strlen("border normal")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:669:52:  [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).
                strncasecmp(bind, "border 1pixel", strlen("border 1pixel")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:670:51:  [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).
                strncasecmp(bind, "border pixel", strlen("border pixel")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:671:56:  [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).
                strncasecmp(bind, "border borderless", strlen("border borderless")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:672:54:  [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).
                strncasecmp(bind, "--no-startup-id", strlen("--no-startup-id")) == 0 ||
data/i3-wm-4.19/src/config_parser.c:673:42:  [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).
                strncasecmp(bind, "bar", strlen("bar")) == 0) {
data/i3-wm-4.19/src/config_parser.c:754:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ret = read(readpipe[0], converted + read_bytes, conv_size - read_bytes);
data/i3-wm-4.19/src/config_parser.c:843: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(new->key) >= strlen(test->key))
data/i3-wm-4.19/src/config_parser.c:843: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 (strlen(new->key) >= strlen(test->key))
data/i3-wm-4.19/src/config_parser.c:921:20:  [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 (buffer[strlen(buffer) - 1] != '\n' && !feof(fstr)) {
data/i3-wm-4.19/src/config_parser.c:927:33:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        const bool skip_line = (sscanf(buffer, "%511s %4095[^\n]", key, value) < 1 || strlen(key) < 3);
data/i3-wm-4.19/src/config_parser.c:927: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).
        const bool skip_line = (sscanf(buffer, "%511s %4095[^\n]", key, value) < 1 || strlen(key) < 3);
data/i3-wm-4.19/src/config_parser.c:936:78:  [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).
            DLOG("line continuation in comment is ignored: \"%.*s\"\n", (int)strlen(buffer) - 1, buffer);
data/i3-wm-4.19/src/config_parser.c:940:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(buf + strlen(buf), buffer, strlen(buffer) + 1);
data/i3-wm-4.19/src/config_parser.c:940:23:  [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).
        strncpy(buf + strlen(buf), buffer, strlen(buffer) + 1);
data/i3-wm-4.19/src/config_parser.c:940:44:  [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).
        strncpy(buf + strlen(buf), buffer, strlen(buffer) + 1);
data/i3-wm-4.19/src/config_parser.c:951:17:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
            if (sscanf(value, "%511s %4095[^\n]", v_key, v_value) < 1) {
data/i3-wm-4.19/src/config_parser.c:978:17:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
            if (sscanf(value, "%511s %511s %4095[^\n]", v_key, res_name, fallback) < 1) {
data/i3-wm-4.19/src/config_parser.c:1018: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).
        int extra = (strlen(current->value) - strlen(current->key));
data/i3-wm-4.19/src/config_parser.c:1018:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        int extra = (strlen(current->value) - strlen(current->key));
data/i3-wm-4.19/src/config_parser.c:1023: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).
             next += strlen(current->key)) {
data/i3-wm-4.19/src/config_parser.c:1052:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(destwalk, walk, (buf + stbuf.st_size) - walk);
data/i3-wm-4.19/src/config_parser.c:1058:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(destwalk, walk, distance);
data/i3-wm-4.19/src/config_parser.c:1059:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(destwalk + distance, nearest->value, strlen(nearest->value));
data/i3-wm-4.19/src/config_parser.c:1059: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).
            strncpy(destwalk + distance, nearest->value, strlen(nearest->value));
data/i3-wm-4.19/src/config_parser.c:1060: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).
            walk += distance + strlen(nearest->key);
data/i3-wm-4.19/src/config_parser.c:1061: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).
            destwalk += distance + strlen(nearest->value);
data/i3-wm-4.19/src/config_parser.c:1070:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        char *converted = migrate_config(new, strlen(new));
data/i3-wm-4.19/src/display_version.c:29:40:  [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).
    human_readable_key = (stringlen == strlen("human_readable") &&
data/i3-wm-4.19/src/display_version.c:30:78:  [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).
                          strncmp((const char *)stringval, "human_readable", strlen("human_readable")) == 0);
data/i3-wm-4.19/src/display_version.c:31:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    loaded_config_file_name_key = (stringlen == strlen("loaded_config_file_name") &&
data/i3-wm-4.19/src/display_version.c:32:96:  [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).
                                   strncmp((const char *)stringval, "loaded_config_file_name", strlen("loaded_config_file_name")) == 0);
data/i3-wm-4.19/src/display_version.c:163:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(fd, destpath, sizeof(destpath)) == -1)
data/i3-wm-4.19/src/ewmh.c:72:23:  [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).
        msg_length += strlen(ws->name) + 1;
data/i3-wm-4.19/src/ewmh.c:80: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).
        for (size_t i = 0; i < strlen(ws->name) + 1; i++) {
data/i3-wm-4.19/src/ewmh.c:218:108:  [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).
        xcb_change_property(conn, XCB_PROP_MODE_REPLACE, window, A__NET_WM_VISIBLE_NAME, A_UTF8_STRING, 8, strlen(name), name);
data/i3-wm-4.19/src/ewmh.c:333:101:  [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).
    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, ewmh_window, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
data/i3-wm-4.19/src/ewmh.c:337:94:  [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).
    xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
data/i3-wm-4.19/src/ipc.c:168:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                ipc_send_client_message(current, strlen(payload), message_type, (uint8_t *)payload);
data/i3-wm-4.19/src/ipc.c:1202: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).
        ipc_send_client_message(client, strlen(reply), I3_IPC_REPLY_TYPE_SUBSCRIBE, (const uint8_t *)reply);
data/i3-wm-4.19/src/ipc.c:1208:37:  [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).
    ipc_send_client_message(client, strlen(reply), I3_IPC_REPLY_TYPE_SUBSCRIBE, (const uint8_t *)reply);
data/i3-wm-4.19/src/ipc.c:1227:37:  [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).
    ipc_send_client_message(client, strlen(payload), I3_IPC_EVENT_TICK, (const uint8_t *)payload);
data/i3-wm-4.19/src/ipc.c:1276:37:  [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).
    ipc_send_client_message(client, strlen(reply), I3_IPC_REPLY_TYPE_TICK, (const uint8_t *)reply);
data/i3-wm-4.19/src/ipc.c:1327: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).
        ipc_send_client_message(client, strlen(reply), I3_IPC_REPLY_TYPE_SYNC, (const uint8_t *)reply);
data/i3-wm-4.19/src/ipc.c:1336:37:  [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).
    ipc_send_client_message(client, strlen(reply), I3_IPC_REPLY_TYPE_SYNC, (const uint8_t *)reply);
data/i3-wm-4.19/src/ipc.c:1439:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    const ssize_t n = read(fd, buf, sizeof(buf));
data/i3-wm-4.19/src/ipc.c:1558:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(addr.sun_path, resolved, sizeof(addr.sun_path) - 1);
data/i3-wm-4.19/src/ipc.c:1712: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).
        client, strlen(reply), I3_IPC_REPLY_TYPE_COMMAND,
data/i3-wm-4.19/src/log.c:281:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(logwalk, message, len);
data/i3-wm-4.19/src/main.c:484:55:  [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).
        DLOG("Command is: %s (%zd bytes)\n", payload, strlen(payload));
data/i3-wm-4.19/src/main.c:498:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1);
data/i3-wm-4.19/src/main.c:503: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).
        if (ipc_send_message(sockfd, strlen(payload), I3_IPC_MESSAGE_TYPE_RUN_COMMAND,
data/i3-wm-4.19/src/main.c:547:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (read(patternfd, cwd, cwd_size) > 0)
data/i3-wm-4.19/src/main.c:575:71:  [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).
    xcb_intern_atom_cookie_t atom##_cookie = xcb_intern_atom(conn, 0, strlen(#atom), #atom);
data/i3-wm-4.19/src/regex.c:78:60:  [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 ((rc = pcre_exec(regex->regex, regex->extra, input, strlen(input), 0, 0, NULL, 0)) == 0) {
data/i3-wm-4.19/src/restore_layout.c:214:67:  [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).
                                A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(con->name), con->name);
data/i3-wm-4.19/src/sd-daemon.c:300: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(path);
data/i3-wm-4.19/src/sd-daemon.c:350:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path));
data/i3-wm-4.19/src/sd-daemon.c:357:21:  [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).
    iovec.iov_len = strlen(state);
data/i3-wm-4.19/src/sd-daemon.c:361:67:  [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).
    msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);
data/i3-wm-4.19/src/util.c:69:28:  [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).
    for (size_t i = 0; i < strlen(name); i++)
data/i3-wm-4.19/src/util.c:223:62:  [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 ystr(str) yajl_gen_string(gen, (unsigned char *)str, strlen(str))
data/i3-wm-4.19/src/workspace.c:187: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(bind->command) < strlen("workspace ") ||
data/i3-wm-4.19/src/workspace.c:187:37:  [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(bind->command) < strlen("workspace ") ||
data/i3-wm-4.19/src/workspace.c:188: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).
            strncasecmp(bind->command, "workspace", strlen("workspace")) != 0)
data/i3-wm-4.19/src/workspace.c:191:46:  [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 char *target = bind->command + strlen("workspace ");
data/i3-wm-4.19/src/workspace.c:199: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).
        if (strncasecmp(target, "next", strlen("next")) == 0 ||
data/i3-wm-4.19/src/workspace.c:200: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).
            strncasecmp(target, "prev", strlen("prev")) == 0 ||
data/i3-wm-4.19/src/workspace.c:201:51:  [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).
            strncasecmp(target, "next_on_output", strlen("next_on_output")) == 0 ||
data/i3-wm-4.19/src/workspace.c:202:51:  [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).
            strncasecmp(target, "prev_on_output", strlen("prev_on_output")) == 0 ||
data/i3-wm-4.19/src/workspace.c:203:51:  [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).
            strncasecmp(target, "back_and_forth", strlen("back_and_forth")) == 0 ||
data/i3-wm-4.19/src/workspace.c:204:44:  [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).
            strncasecmp(target, "current", strlen("current")) == 0)
data/i3-wm-4.19/src/workspace.c:206:61:  [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 (strncasecmp(target, "--no-auto-back-and-forth", strlen("--no-auto-back-and-forth")) == 0) {
data/i3-wm-4.19/src/workspace.c:207:23:  [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).
            target += strlen("--no-auto-back-and-forth");
data/i3-wm-4.19/src/workspace.c:211: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).
        if (strncasecmp(target, "number", strlen("number")) == 0) {
data/i3-wm-4.19/src/workspace.c:212:23:  [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).
            target += strlen("number");
data/i3-wm-4.19/src/workspace.c:219:44:  [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 (strncasecmp(target_name, "__", strlen("__")) == 0) {
data/i3-wm-4.19/src/x.c:177: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).
                        (strlen("i3-frame") + 1) * 2,
data/i3-wm-4.19/src/x.c:851:67:  [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).
                            XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 8, strlen(state->name), state->name);
data/i3-wm-4.19/src/x.c:1405: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(shmlogname), shmlogname);
data/i3-wm-4.19/src/x.c:1416: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).
                        (current_socketpath == NULL ? 0 : strlen(current_socketpath)),
data/i3-wm-4.19/src/x.c:1420: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).
                        strlen(current_configpath), current_configpath);
data/i3-wm-4.19/testcases/inject_randr1.5.c:92:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t n = read(fd, buffer + read_bytes, len - read_bytes);
data/i3-wm-4.19/testcases/inject_randr1.5.c:264: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 (req->name_len == strlen("RANDR") &&
data/i3-wm-4.19/testcases/inject_randr1.5.c:265: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).
            strncmp(name, "RANDR", strlen("RANDR")) == 0) {

ANALYSIS SUMMARY:

Hits = 390
Lines analyzed = 44499 in approximately 2.29 seconds (19450 lines/second)
Physical Source Lines of Code (SLOC) = 27041
Hits@level = [0] 175 [1] 243 [2]  67 [3]  28 [4]  48 [5]   4
Hits@level+ = [0+] 565 [1+] 390 [2+] 147 [3+]  80 [4+]  52 [5+]   4
Hits/KSLOC@level+ = [0+] 20.8942 [1+] 14.4225 [2+] 5.43619 [3+] 2.95847 [4+] 1.92301 [5+] 0.147924
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.