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/rxvt-unicode-9.22/libev/ev++.h Examining data/rxvt-unicode-9.22/libev/ev_epoll.c Examining data/rxvt-unicode-9.22/libev/ev_port.c Examining data/rxvt-unicode-9.22/libev/ev_win32.c Examining data/rxvt-unicode-9.22/libev/ev_poll.c Examining data/rxvt-unicode-9.22/libev/ev_kqueue.c Examining data/rxvt-unicode-9.22/libev/ev.c Examining data/rxvt-unicode-9.22/libev/ev_vars.h Examining data/rxvt-unicode-9.22/libev/ev_wrap.h Examining data/rxvt-unicode-9.22/libev/ev.h Examining data/rxvt-unicode-9.22/libev/ev_select.c Examining data/rxvt-unicode-9.22/src/rxvtd.C Examining data/rxvt-unicode-9.22/src/rxvtc.C Examining data/rxvt-unicode-9.22/src/encoding.C Examining data/rxvt-unicode-9.22/src/scrollbar-rxvt.C Examining data/rxvt-unicode-9.22/src/rxvt.h Examining data/rxvt-unicode-9.22/src/fdpass_wrapper.C Examining data/rxvt-unicode-9.22/src/feature.h Examining data/rxvt-unicode-9.22/src/rxvtimg.C Examining data/rxvt-unicode-9.22/src/rsinc.h Examining data/rxvt-unicode-9.22/src/rxvtutil.h Examining data/rxvt-unicode-9.22/src/rxvtfont.h Examining data/rxvt-unicode-9.22/src/xdefaults.C Examining data/rxvt-unicode-9.22/src/command.C Examining data/rxvt-unicode-9.22/src/version.h Examining data/rxvt-unicode-9.22/src/scrollbar-next.C Examining data/rxvt-unicode-9.22/src/hookinc.h Examining data/rxvt-unicode-9.22/src/rxvtimg.h Examining data/rxvt-unicode-9.22/src/emman.h Examining data/rxvt-unicode-9.22/src/table/iso8859_15.h Examining data/rxvt-unicode-9.22/src/table/ksc5601_1987_0.h Examining data/rxvt-unicode-9.22/src/table/iso8859_13.h Examining data/rxvt-unicode-9.22/src/table/big5.h Examining data/rxvt-unicode-9.22/src/table/iso8859_1.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_2.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_4.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_7.h Examining data/rxvt-unicode-9.22/src/table/iso8859_7.h Examining data/rxvt-unicode-9.22/src/table/iso8859_4.h Examining data/rxvt-unicode-9.22/src/table/jis0208_1990_0.h Examining data/rxvt-unicode-9.22/src/table/iso8859_11.h Examining data/rxvt-unicode-9.22/src/table/iso8859_14.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_f.h Examining data/rxvt-unicode-9.22/src/table/koi8_u.h Examining data/rxvt-unicode-9.22/src/table/iso8859_5.h Examining data/rxvt-unicode-9.22/src/table/iso8859_6.h Examining data/rxvt-unicode-9.22/src/table/gbk_0.h Examining data/rxvt-unicode-9.22/src/table/iso8859_16.h Examining data/rxvt-unicode-9.22/src/table/linedraw.h Examining data/rxvt-unicode-9.22/src/table/iso8859_9.h Examining data/rxvt-unicode-9.22/src/table/jis0213_1.h Examining data/rxvt-unicode-9.22/src/table/iso8859_8.h Examining data/rxvt-unicode-9.22/src/table/big5_ext.h Examining data/rxvt-unicode-9.22/src/table/iso8859_3.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_3.h Examining data/rxvt-unicode-9.22/src/table/iso8859_2.h Examining data/rxvt-unicode-9.22/src/table/jis0212_1990_0.h Examining data/rxvt-unicode-9.22/src/table/jis0213_2.h Examining data/rxvt-unicode-9.22/src/table/iso8859_10.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_6.h Examining data/rxvt-unicode-9.22/src/table/jis0201_1976_0.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_5.h Examining data/rxvt-unicode-9.22/src/table/gb2312_1980_0.h Examining data/rxvt-unicode-9.22/src/table/viscii.h Examining data/rxvt-unicode-9.22/src/table/cns11643_1992_1.h Examining data/rxvt-unicode-9.22/src/table/category.h Examining data/rxvt-unicode-9.22/src/table/compose.h Examining data/rxvt-unicode-9.22/src/table/koi8_r.h Examining data/rxvt-unicode-9.22/src/table/big5_plus.h Examining data/rxvt-unicode-9.22/src/ev_cpp.h Examining data/rxvt-unicode-9.22/src/keyboard.C Examining data/rxvt-unicode-9.22/src/emman.c Examining data/rxvt-unicode-9.22/src/main.C Examining data/rxvt-unicode-9.22/src/command.h Examining data/rxvt-unicode-9.22/src/rxvtdaemon.h Examining data/rxvt-unicode-9.22/src/rxvt.C Examining data/rxvt-unicode-9.22/src/init.h Examining data/rxvt-unicode-9.22/src/keyboard.h Examining data/rxvt-unicode-9.22/src/rxvttoolkit.h Examining data/rxvt-unicode-9.22/src/ev_cpp.C Examining data/rxvt-unicode-9.22/src/scrollbar.C Examining data/rxvt-unicode-9.22/src/init.C Examining data/rxvt-unicode-9.22/src/rxvtutil.C Examining data/rxvt-unicode-9.22/src/encoding.h Examining data/rxvt-unicode-9.22/src/rxvtperl.h Examining data/rxvt-unicode-9.22/src/scrollbar-xterm.C Examining data/rxvt-unicode-9.22/src/scrollbar.h Examining data/rxvt-unicode-9.22/src/iom_perl.h Examining data/rxvt-unicode-9.22/src/ptytty_wrapper.C Examining data/rxvt-unicode-9.22/src/callback.h Examining data/rxvt-unicode-9.22/src/optinc.h Examining data/rxvt-unicode-9.22/src/screen.C Examining data/rxvt-unicode-9.22/src/scrollbar-plain.C Examining data/rxvt-unicode-9.22/src/misc.C Examining data/rxvt-unicode-9.22/src/rxvtdaemon.C Examining data/rxvt-unicode-9.22/src/background.C Examining data/rxvt-unicode-9.22/src/rxvttoolkit.C Examining data/rxvt-unicode-9.22/src/rxvtfont.C Examining data/rxvt-unicode-9.22/libptytty/src/proxy.C Examining data/rxvt-unicode-9.22/libptytty/src/ptytty_conf.h Examining data/rxvt-unicode-9.22/libptytty/src/ptytty.h Examining data/rxvt-unicode-9.22/libptytty/src/estl.h Examining data/rxvt-unicode-9.22/libptytty/src/logging.C Examining data/rxvt-unicode-9.22/libptytty/src/libptytty.h Examining data/rxvt-unicode-9.22/libptytty/src/fdpass.C Examining data/rxvt-unicode-9.22/libptytty/src/ptytty.C Examining data/rxvt-unicode-9.22/libptytty/src/ecb.h FINAL RESULTS: data/rxvt-unicode-9.22/libptytty/src/ptytty.C:308:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod (name, RESTORE_TTY_MODE); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:309:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown (name, 0, ttyconf.gid); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:334:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown (name, getuid (), ttyconf.gid); /* fail silently */ data/rxvt-unicode-9.22/libptytty/src/ptytty.C:335:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod (name, ttyconf.mode); data/rxvt-unicode-9.22/libev/ev.c:4255:11: [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 (path, w->path); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:168: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 (tty_name, R_OK | W_OK) == 0) data/rxvt-unicode-9.22/src/command.C:192:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", data/rxvt-unicode-9.22/src/command.C:519:19: [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 (kbuf, rs[Rs_backspace_key]); data/rxvt-unicode-9.22/src/command.C:524:17: [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 (kbuf, rs[Rs_delete_key]); data/rxvt-unicode-9.22/src/command.C:2458:18: [4] (shell) popen: 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. FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); data/rxvt-unicode-9.22/src/command.C:4065:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf ((char *)buf, 256, fmt, arg_ptr); data/rxvt-unicode-9.22/src/init.C:119:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (ifr2.ifr_name, ifr->ifr_name); data/rxvt-unicode-9.22/src/init.C:140:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (rval, "%d.%d.%d.%d%s", data/rxvt-unicode-9.22/src/init.C:917:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (env_display, "DISPLAY=%s", val); data/rxvt-unicode-9.22/src/init.C:948:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (env_term, "TERM=%s", rs[Rs_term_name]); data/rxvt-unicode-9.22/src/init.C:1632:7: [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 (argv[0], (char *const *)argv); data/rxvt-unicode-9.22/src/init.C:1649:11: [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 (&login[1], argv0); data/rxvt-unicode-9.22/src/init.C:1653:7: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execlp (shell, argv0, (char *)0); data/rxvt-unicode-9.22/src/main.C:82:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (savelocale, curlocale); data/rxvt-unicode-9.22/src/main.C:1034:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); data/rxvt-unicode-9.22/src/misc.C:209:3: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (msg, sizeof msg, fmt, arg_ptr); data/rxvt-unicode-9.22/src/rxvt.h:109:10: [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). # define strcpy(a,b) (strcpy)(a,b) data/rxvt-unicode-9.22/src/rxvt.h:109:25: [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). # define strcpy(a,b) (strcpy)(a,b) data/rxvt-unicode-9.22/src/rxvtc.C:63:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (sa.sun_path, sockname); data/rxvt-unicode-9.22/src/rxvtd.C:103:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (sa.sun_path, sockname); data/rxvt-unicode-9.22/src/rxvtd.C:154:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (err, 1024, format, ap); data/rxvt-unicode-9.22/src/rxvtfont.C:692:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (*ptr + len, replace); data/rxvt-unicode-9.22/src/rxvtfont.C:693:7: [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 (*ptr, end); data/rxvt-unicode-9.22/src/rxvttoolkit.C:462:7: [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 (val, id); data/rxvt-unicode-9.22/src/xdefaults.C:585:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (res, "*.%s: %s\n", opt, argv[i]); data/rxvt-unicode-9.22/libev/ev.c:2861:14: [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 ("LIBEV_FLAGS")) data/rxvt-unicode-9.22/libev/ev.c:2862: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. flags = atoi (getenv ("LIBEV_FLAGS")); data/rxvt-unicode-9.22/src/init.C:584: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. if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) data/rxvt-unicode-9.22/src/init.C:1639: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 ((shell = getenv ("SHELL")) == NULL || *shell == '\0') data/rxvt-unicode-9.22/src/rxvtd.C:275: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 (const char *dpy = getenv ("DISPLAY")) data/rxvt-unicode-9.22/src/rxvtdaemon.C:39:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *path = getenv ("RXVT_SOCKET"); data/rxvt-unicode-9.22/src/rxvtdaemon.C:46:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. path = getenv ("HOME"); data/rxvt-unicode-9.22/src/rxvttoolkit.C:331:19: [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 *homedir = getenv ("HOME"); data/rxvt-unicode-9.22/src/rxvttoolkit.C:351:14: [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 (!(xe = getenv ("XAPPLRESDIR"))) data/rxvt-unicode-9.22/src/rxvttoolkit.C:435:13: [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 ((xe = getenv ("XENVIRONMENT")) data/rxvt-unicode-9.22/libev/ev.c:466:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pad[128 - sizeof (uint32_t)]; data/rxvt-unicode-9.22/libev/ev.c:1352:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 4); data/rxvt-unicode-9.22/libev/ev.c:1392:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 4); data/rxvt-unicode-9.22/libev/ev.c:1422:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 8); data/rxvt-unicode-9.22/libev/ev.c:1462:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 8); data/rxvt-unicode-9.22/libev/ev.c:2492:11: [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 dummy[4]; data/rxvt-unicode-9.22/libev/ev.c:2862:17: [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). flags = atoi (getenv ("LIBEV_FLAGS")); data/rxvt-unicode-9.22/libev/ev.c:4254:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path [4096]; data/rxvt-unicode-9.22/libev/ev.c:4334:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [EV_INOTIFY_BUFSIZE]; data/rxvt-unicode-9.22/libev/ev.c:5020:34: [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. cb (EV_A_ EV_STAT, ((char *)ANHE_w (timers [i])) - offsetof (struct ev_stat, timer)); data/rxvt-unicode-9.22/libev/ev_select.c:155:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (vec_ro, vec_ri, fd_setsize); data/rxvt-unicode-9.22/libev/ev_select.c:156:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (vec_wo, vec_wi, fd_setsize); data/rxvt-unicode-9.22/libev/ev_select.c:164:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (vec_eo, vec_wi, fd_setsize); data/rxvt-unicode-9.22/libptytty/src/ecb.h:860:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 4); data/rxvt-unicode-9.22/libptytty/src/ecb.h:900:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 4); data/rxvt-unicode-9.22/libptytty/src/ecb.h:930:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 8); data/rxvt-unicode-9.22/libptytty/src/ecb.h:970:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&r, &x, 8); data/rxvt-unicode-9.22/libptytty/src/estl.h:179:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (dst, src, sizeof (T) * n); data/rxvt-unicode-9.22/libptytty/src/logging.C:117:30: [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 (utmp_pos <= 0 || (fd = open (UTMP_FILE, O_WRONLY)) == -1) data/rxvt-unicode-9.22/libptytty/src/logging.C:138:13: [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 (fname, O_WRONLY | O_APPEND, 0)) < 0) data/rxvt-unicode-9.22/libptytty/src/logging.C:197:13: [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 (LASTLOG_FILE, O_RDWR)) != -1) data/rxvt-unicode-9.22/libptytty/src/proxy.C:54:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hostname[512]; // arbitrary, but should be plenty data/rxvt-unicode-9.22/libptytty/src/proxy.C:294:19: [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 fd2 = open ("/dev/tty", fd ? O_WRONLY : O_RDONLY); data/rxvt-unicode-9.22/libptytty/src/proxy.C:297:17: [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). fd2 = open ("/dev/null", fd ? O_WRONLY : O_RDONLY); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:82:11: [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). pfd = open ("/dev/ptc", O_RDWR | O_NOCTTY, 0); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:84:11: [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). pfd = open ("/dev/ptmx", O_RDWR | O_NOCTTY, 0); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:150: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 pty_name[32]; data/rxvt-unicode-9.22/libptytty/src/ptytty.C:151: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 tty_name[32]; data/rxvt-unicode-9.22/libptytty/src/ptytty.C:160:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((pfd = open (pty_name, O_RDWR | O_NOCTTY, 0)) == -1) data/rxvt-unicode-9.22/libptytty/src/ptytty.C:164:24: [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 ((pfd = open (pty_name, O_RDWR | O_NOCTTY, 0)) == -1) data/rxvt-unicode-9.22/libptytty/src/ptytty.C:189:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return open (ttydev, O_RDWR | O_NOCTTY, 0); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:206:8: [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). fd = open (ttyname (fd_tty), O_RDWR); data/rxvt-unicode-9.22/libptytty/src/ptytty.C:211:8: [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). fd = open ("/dev/tty", O_WRONLY); data/rxvt-unicode-9.22/src/background.C:345:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (f, file, len); data/rxvt-unicode-9.22/src/background.C:413:19: [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 new_shade = atoi (shade_str); data/rxvt-unicode-9.22/src/command.C:187:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char rowcol[40]; data/rxvt-unicode-9.22/src/command.C:190:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char attr[80]; // plenty data/rxvt-unicode-9.22/src/command.C:227:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[9]; data/rxvt-unicode-9.22/src/command.C:231:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (buf, "%8x", ch); data/rxvt-unicode-9.22/src/command.C:270:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mb[MB_LEN_MAX]; data/rxvt-unicode-9.22/src/command.C:402:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (r, str, len * sizeof (wchar_t)); data/rxvt-unicode-9.22/src/command.C:412:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char rkbuf[KBUFSZ + 1]; data/rxvt-unicode-9.22/src/command.C:446:11: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t wkbuf[KBUFSZ + 1]; data/rxvt-unicode-9.22/src/command.C:529:19: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (kbuf, "\033[Z"); data/rxvt-unicode-9.22/src/command.C:548:17: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (kbuf, "\033[Z"); data/rxvt-unicode-9.22/src/command.C:566:21: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (kbuf, "\033OM"); data/rxvt-unicode-9.22/src/command.C:590:17: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (kbuf, "\033OP"); data/rxvt-unicode-9.22/src/command.C:613:21: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (kbuf, "\033Oj"); data/rxvt-unicode-9.22/src/command.C:627:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (kbuf,"\033[%d~", param); data/rxvt-unicode-9.22/src/command.C:668:11: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (kbuf, "\033[Z"); data/rxvt-unicode-9.22/src/command.C:1180:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (cmdbuf_endp, str, count); data/rxvt-unicode-9.22/src/command.C:1852:44: [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). pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); data/rxvt-unicode-9.22/src/command.C:2289:11: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t buf[UBUFSIZ]; data/rxvt-unicode-9.22/src/command.C:2490:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[8]; data/rxvt-unicode-9.22/src/command.C:3249:3: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t string[CBUFSIZ]; data/rxvt-unicode-9.22/src/command.C:3427:21: [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). color = atoi (buf) + minCOLOR; data/rxvt-unicode-9.22/src/command.C:3500: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 str[256]; data/rxvt-unicode-9.22/src/command.C:3506:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (str, "[%dx%d+%d+%d]", data/rxvt-unicode-9.22/src/command.C:3556:21: [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 (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) data/rxvt-unicode-9.22/src/command.C:3610: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 lines = atoi (str); data/rxvt-unicode-9.22/src/command.C:4062:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/rxvt-unicode-9.22/src/command.C:4119:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (v_buffer + v_buflen, data, len); data/rxvt-unicode-9.22/src/emman.c:128:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (ptr2, ptr, old_size); data/rxvt-unicode-9.22/src/encoding.C:107:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char res[16]; data/rxvt-unicode-9.22/src/init.C:89:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024], *rval = NULL; data/rxvt-unicode-9.22/src/init.C:646:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (rs[Rs_saveLines] && (i = atoi (rs[Rs_saveLines])) >= 0) data/rxvt-unicode-9.22/src/init.C:650:33: [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). if (rs[Rs_int_bwidth] && (i = atoi (rs[Rs_int_bwidth])) >= 0) data/rxvt-unicode-9.22/src/init.C:653:33: [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). if (rs[Rs_ext_bwidth] && (i = atoi (rs[Rs_ext_bwidth])) >= 0) data/rxvt-unicode-9.22/src/init.C:656:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (rs[Rs_lineSpace] && (i = atoi (rs[Rs_lineSpace])) >= 0) data/rxvt-unicode-9.22/src/init.C:660:19: [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). letterSpace = atoi (rs[Rs_letterSpace]); data/rxvt-unicode-9.22/src/init.C:664:40: [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). if (rs[Rs_pointerBlankDelay] && (i = atoi (rs[Rs_pointerBlankDelay])) >= 0) data/rxvt-unicode-9.22/src/init.C:670:37: [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). if (rs[Rs_multiClickTime] && (i = atoi (rs[Rs_multiClickTime])) >= 0) data/rxvt-unicode-9.22/src/init.C:758: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. env = new char *[this->envv->size ()]; data/rxvt-unicode-9.22/src/init.C:920:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (env_windowid, "WINDOWID=%lu", (unsigned long)parent); data/rxvt-unicode-9.22/src/init.C:947:19: [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. env_term = (char *)rxvt_malloc (strlen (rs[Rs_term_name]) + 6); data/rxvt-unicode-9.22/src/init.C:1114:15: [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 i = atoi (rs[Rs_color + idx]); data/rxvt-unicode-9.22/src/init.C:1350:26: [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. classHint.res_name = (char *)rs[Rs_name]; data/rxvt-unicode-9.22/src/init.C:1481:18: [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). pty->pty = atoi (rs[Rs_pty_fd]); data/rxvt-unicode-9.22/src/init.C:1597:12: [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). fd = open (CONSOLE, O_WRONLY, 0); data/rxvt-unicode-9.22/src/main.C:61: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 curlocale[128], savelocale[128]; data/rxvt-unicode-9.22/src/main.C:74:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (curlocale, locale, size); data/rxvt-unicode-9.22/src/main.C:397:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[BUFSIZ]; data/rxvt-unicode-9.22/src/main.C:398:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mesg[BUFSIZ]; data/rxvt-unicode-9.22/src/main.C:399:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char number[32]; data/rxvt-unicode-9.22/src/main.C:454:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (number, "RENDER.%d", event->minor_code); data/rxvt-unicode-9.22/src/main.C:464:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (number, "%d", event->request_code); data/rxvt-unicode-9.22/src/main.C:958:15: [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 i = atoi (color); data/rxvt-unicode-9.22/src/main.C:1019:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (fstr, "%d", i - Color_Black); data/rxvt-unicode-9.22/src/main.C:1026:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (bstr, "%d", i - Color_Black); data/rxvt-unicode-9.22/src/main.C:1228:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char server[IMBUFSIZ]; data/rxvt-unicode-9.22/src/main.C:1233:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (server, "@server="); data/rxvt-unicode-9.22/src/main.C:1458:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pat[512]; data/rxvt-unicode-9.22/src/main.C:1460:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (pat, data/rxvt-unicode-9.22/src/main.C:1585:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[IMBUFSIZ]; data/rxvt-unicode-9.22/src/main.C:1608:15: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (buf, "@im="); data/rxvt-unicode-9.22/src/misc.C:207:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[1024]; data/rxvt-unicode-9.22/src/rxvt.h:111:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define memcpy(a,b,l) (memcpy)(a,b,l) data/rxvt-unicode-9.22/src/rxvt.h:111:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define memcpy(a,b,l) (memcpy)(a,b,l) data/rxvt-unicode-9.22/src/rxvt.h:1227:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char charsets[4]; data/rxvt-unicode-9.22/src/rxvt.h:1240: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. const char *rs[NUM_RESOURCES]; data/rxvt-unicode-9.22/src/rxvt.h:1243:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmdbuf_base[CBUFSIZ]; data/rxvt-unicode-9.22/src/rxvtc.C:79:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cwd[PATH_MAX]; data/rxvt-unicode-9.22/src/rxvtd.C:150:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char err[1024]; data/rxvt-unicode-9.22/src/rxvtdaemon.C:38:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[PATH_MAX]; data/rxvt-unicode-9.22/src/rxvtfont.C:636: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. const char *comp[13]; data/rxvt-unicode-9.22/src/rxvtfont.C:650:31: [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). return set_properties (p, atoi (comp[6]), comp[2], comp[3], atoi (comp[11])); data/rxvt-unicode-9.22/src/rxvtfont.C:650:65: [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). return set_properties (p, atoi (comp[6]), comp[2], comp[3], atoi (comp[11])); data/rxvt-unicode-9.22/src/rxvtfont.C:691:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (*ptr, name, len); data/rxvt-unicode-9.22/src/rxvtfont.C:712:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char field_str[64]; // enough for 128 bits data/rxvt-unicode-9.22/src/rxvtfont.C:754:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (field_str, "%d", prop.height == rxvt_fontprop::unset data/rxvt-unicode-9.22/src/rxvtfont.C:858:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char charset[64]; data/rxvt-unicode-9.22/src/rxvtfont.C:1579:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/rxvt-unicode-9.22/src/rxvtfont.C:1591:15: [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 spec[256]; data/rxvt-unicode-9.22/src/rxvtfont.C:1602:15: [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 (spec, extra, min (desc - extra, 255)); data/rxvt-unicode-9.22/src/rxvtfont.C:1620:15: [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 (buf, desc, end - desc); data/rxvt-unicode-9.22/src/rxvtfont.C:1767:23: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fontname[4096]; data/rxvt-unicode-9.22/src/rxvtfont.h:120:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char cppsucks[256]; data/rxvt-unicode-9.22/src/rxvttoolkit.C:332:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[1024]; data/rxvt-unicode-9.22/src/rxvttoolkit.C:461:7: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (val, "unix/"); data/rxvt-unicode-9.22/src/rxvttoolkit.C:695:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (id, locale, l); id[l] = '\n'; data/rxvt-unicode-9.22/src/rxvttoolkit.C:696:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (id + l + 1, modifiers, m); id[l + m + 1] = 0; data/rxvt-unicode-9.22/src/rxvttoolkit.C:1205:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (incr_buf + incr_buf_fill, ct.value, ct.nitems); data/rxvt-unicode-9.22/src/screen.C:209:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (dst.t, src.t, sizeof (text_t) * dst.l); data/rxvt-unicode-9.22/src/screen.C:210:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (dst.r, src.r, sizeof (rend_t) * dst.l); data/rxvt-unicode-9.22/src/screen.C:299:11: [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 (drawn_buf [row].t, prev_drawn_buf [row].t, sizeof (text_t) * common_col); data/rxvt-unicode-9.22/src/screen.C:300:11: [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 (drawn_buf [row].r, prev_drawn_buf [row].r, sizeof (rend_t) * common_col); data/rxvt-unicode-9.22/src/screen.C:377:23: [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 (qline->t + qcol, pline.t + pcol, len * sizeof (text_t)); data/rxvt-unicode-9.22/src/screen.C:378:23: [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 (qline->r + qcol, pline.r + pcol, len * sizeof (rend_t)); data/rxvt-unicode-9.22/src/screen.C:2008:11: [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 mb[MB_LEN_MAX]; data/rxvt-unicode-9.22/src/scrollbar.C:186:27: [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). if (thickness && (i = atoi (thickness)) >= SB_WIDTH_MINIMUM) data/rxvt-unicode-9.22/src/xdefaults.C:665:37: [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. = (void (*)(rxvt_term *, const char *, const char *)) data/rxvt-unicode-9.22/src/xdefaults.C:665:51: [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. = (void (*)(rxvt_term *, const char *, const char *)) data/rxvt-unicode-9.22/src/xdefaults.C:787:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char resource[512]; data/rxvt-unicode-9.22/libev/ev.c:1673: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). write (STDERR_FILENO, msg, strlen (msg)); data/rxvt-unicode-9.22/libev/ev.c:2487:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read (evpipe [1], &counter, sizeof (uint64_t)); data/rxvt-unicode-9.22/libev/ev.c:2501:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read (evpipe [0], &dummy, sizeof (dummy)); data/rxvt-unicode-9.22/libev/ev.c:2602:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t res = read (sigfd, si, sizeof (si)); data/rxvt-unicode-9.22/libev/ev.c:4252: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). if ((errno == ENOENT || errno == EACCES) && strlen (w->path) < 4096) data/rxvt-unicode-9.22/libev/ev.c:4336:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = read (fs_fd, buf, sizeof (buf)); data/rxvt-unicode-9.22/libptytty/src/logging.C:187:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (llx.ll_line, pty, sizeof (llx.ll_line)); data/rxvt-unicode-9.22/libptytty/src/logging.C:188:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (llx.ll_host, host, sizeof (llx.ll_host)); data/rxvt-unicode-9.22/libptytty/src/logging.C:195:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ll.ll_line, pty, sizeof (ll.ll_line)); data/rxvt-unicode-9.22/libptytty/src/logging.C:196:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ll.ll_host, host, sizeof (ll.ll_host)); data/rxvt-unicode-9.22/libptytty/src/logging.C:212:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen (line); data/rxvt-unicode-9.22/libptytty/src/logging.C:216:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (id, line, id_size); data/rxvt-unicode-9.22/libptytty/src/logging.C:226:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut->ut_line, line, sizeof (ut->ut_line)); data/rxvt-unicode-9.22/libptytty/src/logging.C:237:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut->ut_user, user, sizeof (ut->ut_user)); data/rxvt-unicode-9.22/libptytty/src/logging.C:239:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut->ut_name, user, sizeof (ut->ut_name)); data/rxvt-unicode-9.22/libptytty/src/logging.C:242:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut->ut_host, host, sizeof (ut->ut_host)); data/rxvt-unicode-9.22/libptytty/src/logging.C:257:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (utx->ut_line, line, sizeof (utx->ut_line)); data/rxvt-unicode-9.22/libptytty/src/logging.C:268:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (utx->ut_user, user, sizeof (utx->ut_user)); data/rxvt-unicode-9.22/libptytty/src/logging.C:273:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (utx->ut_host, host, sizeof (utx->ut_host)); data/rxvt-unicode-9.22/libptytty/src/proxy.C:73:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define NEED_TOKEN do { char ch; read (lock_fd, &ch , 1); } while (0) data/rxvt-unicode-9.22/libptytty/src/proxy.C:91:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (sock_fd, &id, sizeof (id)) != sizeof (id)) data/rxvt-unicode-9.22/libptytty/src/proxy.C:119:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (cmd.hostname, hostname, sizeof (cmd.hostname)); data/rxvt-unicode-9.22/libptytty/src/proxy.C:158:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (sock_fd, &cmd, sizeof (command)) != sizeof (command)) data/rxvt-unicode-9.22/src/command.C:208:42: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). max_it (width, wcswidth (fname[i], wcslen (fname[i]))); data/rxvt-unicode-9.22/src/command.C:211:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). max_it (width, strlen (attr)); data/rxvt-unicode-9.22/src/command.C:635: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). len = strlen (kbuf); data/rxvt-unicode-9.22/src/command.C:1202:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t r = read (pty->pty, cmdbuf_endp, avail); data/rxvt-unicode-9.22/src/command.C:2551: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). tt_write (rs [Rs_answerbackstring], strlen (rs [Rs_answerbackstring])); data/rxvt-unicode-9.22/src/command.C:2553: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). tt_write (VT100_ANS, strlen (VT100_ANS)); data/rxvt-unicode-9.22/src/command.C:4067:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tt_write (buf, strlen (buf)); data/rxvt-unicode-9.22/src/encoding.C:133: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 (i->name); data/rxvt-unicode-9.22/src/init.C:139: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). rval = rxvt_malloc (strlen (colon) + 16); data/rxvt-unicode-9.22/src/init.C:915: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). env_display = (char *)rxvt_malloc (strlen (val) + 9); data/rxvt-unicode-9.22/src/init.C:947: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). env_term = (char *)rxvt_malloc (strlen (rs[Rs_term_name]) + 6); data/rxvt-unicode-9.22/src/init.C:1198: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). if (rsmod && strncasecmp (rsmod, cm, strlen (cm)) == 0) data/rxvt-unicode-9.22/src/init.C:1646: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). login = (char *)rxvt_malloc (strlen (argv0) + 2); data/rxvt-unicode-9.22/src/keyboard.C:179: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). term->cmdbuf_append (str + 8, strlen (str) - 8); data/rxvt-unicode-9.22/src/keyboard.C:181: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). term->tt_write_user_input (colon + 1, strlen (colon + 1)); data/rxvt-unicode-9.22/src/keyboard.C:188: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). term->tt_write_user_input (str, strlen (str)); data/rxvt-unicode-9.22/src/main.C:66: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). int size = strlen (locale) + 1; data/rxvt-unicode-9.22/src/main.C:894:65: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (const unsigned char *)str, len >= 0 ? len : strlen (str)); data/rxvt-unicode-9.22/src/main.C:917: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 unsigned char *)s, strlen (s)); data/rxvt-unicode-9.22/src/main.C:1234:7: [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 (server, p + 4, IMBUFSIZ - 9); /* skip "@im=" */ data/rxvt-unicode-9.22/src/main.C:1609:15: [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 (buf, s[i], IMBUFSIZ - 5); data/rxvt-unicode-9.22/src/misc.C:55:22: [1] (buffer) wcslen: Does not handle 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 < 0) len = wcslen (str); data/rxvt-unicode-9.22/src/misc.C:82: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). if (len < 0) len = strlen (str); data/rxvt-unicode-9.22/src/misc.C:95:22: [1] (buffer) wcslen: Does not handle 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 < 0) len = wcslen (str); data/rxvt-unicode-9.22/src/misc.C:130: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). if (len < 0) len = strlen (str); data/rxvt-unicode-9.22/src/misc.C:214: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). write (STDOUT_FILENO, msg, strlen (msg)); data/rxvt-unicode-9.22/src/misc.C:278: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). r = s + strlen (s) - 1; data/rxvt-unicode-9.22/src/rxvt.h:108:10: [1] (buffer) strlen: Does not handle 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 strlen(a) (strlen)(a) data/rxvt-unicode-9.22/src/rxvt.h:108: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). # define strlen(a) (strlen)(a) data/rxvt-unicode-9.22/src/rxvtc.C:50:7: [1] (buffer) strlen: Does not handle 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 (sockname) >= sizeof (sa.sun_path)) data/rxvt-unicode-9.22/src/rxvtd.C:87:7: [1] (buffer) strlen: Does not handle 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 (sockname) >= sizeof(sa.sun_path)) data/rxvt-unicode-9.22/src/rxvtd.C:107:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t omask = umask (0077); data/rxvt-unicode-9.22/src/rxvtd.C:115:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (omask); data/rxvt-unicode-9.22/src/rxvtdaemon.C:78: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). send (data, strlen (data)); data/rxvt-unicode-9.22/src/rxvtdaemon.C:86:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, s, 2) != 2) data/rxvt-unicode-9.22/src/rxvtdaemon.C:98:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, data, l) != l) data/rxvt-unicode-9.22/src/rxvtdaemon.C:119:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, s, 4) != 4) data/rxvt-unicode-9.22/src/rxvtfont.C:690: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). *ptr = (char *)malloc (len + strlen (replace) + strlen (end) + 1); data/rxvt-unicode-9.22/src/rxvtfont.C:690: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). *ptr = (char *)malloc (len + strlen (replace) + strlen (end) + 1); data/rxvt-unicode-9.22/src/rxvtfont.C:1616: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). end = desc + strlen (desc); data/rxvt-unicode-9.22/src/rxvttoolkit.C:459: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). char *val = rxvt_temp_buf<char> (5 + strlen (id) + 1); data/rxvt-unicode-9.22/src/rxvttoolkit.C:689:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen (locale); data/rxvt-unicode-9.22/src/rxvttoolkit.C:690:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). m = strlen (modifiers); data/rxvt-unicode-9.22/src/rxvttoolkit.C:844:7: [1] (buffer) strlen: Does not handle 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 (name) != 4+5*4 || 4 != sscanf (name, "rgba:%4hx/%4hx/%4hx/%4hx%c", &c.r, &c.g, &c.b, &c.a, &eos)) data/rxvt-unicode-9.22/src/rxvttoolkit.C:1034: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). finish (str, strlen (str)); data/rxvt-unicode-9.22/src/rxvttoolkit.C:1239: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). data_len = strlen (data); data/rxvt-unicode-9.22/src/screen.C:3510: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). ct.nitems = strlen ((char *)ct.value); data/rxvt-unicode-9.22/src/xdefaults.C:421: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). len = strlen (optList[i].arg) + 1; data/rxvt-unicode-9.22/src/xdefaults.C:424: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). len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2 : 0); data/rxvt-unicode-9.22/src/xdefaults.C:452: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). (INDENT - strlen (optList[i].opt) data/rxvt-unicode-9.22/src/xdefaults.C:475: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). (INDENT + 2 - strlen (optList[i].kw)), "", /* XXX */ data/rxvt-unicode-9.22/src/xdefaults.C:584: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). char *res = rxvt_temp_buf<char> (strlen (opt) + strlen (argv[++i]) + 6); data/rxvt-unicode-9.22/src/xdefaults.C:584:63: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *res = rxvt_temp_buf<char> (strlen (opt) + strlen (argv[++i]) + 6); data/rxvt-unicode-9.22/src/xdefaults.C:775:95: [1] (buffer) wcslen: Does not handle 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 (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END))) ANALYSIS SUMMARY: Hits = 250 Lines analyzed = 73062 in approximately 4.18 seconds (17489 lines/second) Physical Source Lines of Code (SLOC) = 63186 Hits@level = [0] 46 [1] 77 [2] 133 [3] 10 [4] 26 [5] 4 Hits@level+ = [0+] 296 [1+] 250 [2+] 173 [3+] 40 [4+] 30 [5+] 4 Hits/KSLOC@level+ = [0+] 4.68458 [1+] 3.95657 [2+] 2.73795 [3+] 0.633052 [4+] 0.474789 [5+] 0.0633052 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.