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/rc-1.7.4+97.gceb59bb/addon.c Examining data/rc-1.7.4+97.gceb59bb/addon.h Examining data/rc-1.7.4+97.gceb59bb/builtins.c Examining data/rc-1.7.4+97.gceb59bb/develop.c Examining data/rc-1.7.4+97.gceb59bb/develop.h Examining data/rc-1.7.4+97.gceb59bb/edit-bsd.c Examining data/rc-1.7.4+97.gceb59bb/edit-edit.c Examining data/rc-1.7.4+97.gceb59bb/edit-editline.c Examining data/rc-1.7.4+97.gceb59bb/edit-null.c Examining data/rc-1.7.4+97.gceb59bb/edit-vrl.c Examining data/rc-1.7.4+97.gceb59bb/edit.h Examining data/rc-1.7.4+97.gceb59bb/except.c Examining data/rc-1.7.4+97.gceb59bb/exec.c Examining data/rc-1.7.4+97.gceb59bb/execve.c Examining data/rc-1.7.4+97.gceb59bb/fn.c Examining data/rc-1.7.4+97.gceb59bb/footobar.c Examining data/rc-1.7.4+97.gceb59bb/getgroups.h Examining data/rc-1.7.4+97.gceb59bb/getopt.c Examining data/rc-1.7.4+97.gceb59bb/glob.c Examining data/rc-1.7.4+97.gceb59bb/glom.c Examining data/rc-1.7.4+97.gceb59bb/hash.c Examining data/rc-1.7.4+97.gceb59bb/heredoc.c Examining data/rc-1.7.4+97.gceb59bb/history.c Examining data/rc-1.7.4+97.gceb59bb/input.c Examining data/rc-1.7.4+97.gceb59bb/input.h Examining data/rc-1.7.4+97.gceb59bb/jbwrap.h Examining data/rc-1.7.4+97.gceb59bb/lex.c Examining data/rc-1.7.4+97.gceb59bb/list.c Examining data/rc-1.7.4+97.gceb59bb/main.c Examining data/rc-1.7.4+97.gceb59bb/match.c Examining data/rc-1.7.4+97.gceb59bb/mksignal.c Examining data/rc-1.7.4+97.gceb59bb/mkstatval.c Examining data/rc-1.7.4+97.gceb59bb/nalloc.c Examining data/rc-1.7.4+97.gceb59bb/nonblock.c Examining data/rc-1.7.4+97.gceb59bb/open.c Examining data/rc-1.7.4+97.gceb59bb/print.c Examining data/rc-1.7.4+97.gceb59bb/proto.h Examining data/rc-1.7.4+97.gceb59bb/redir.c Examining data/rc-1.7.4+97.gceb59bb/rlimit.h Examining data/rc-1.7.4+97.gceb59bb/signal.c Examining data/rc-1.7.4+97.gceb59bb/stat.h Examining data/rc-1.7.4+97.gceb59bb/status.c Examining data/rc-1.7.4+97.gceb59bb/system-bsd.c Examining data/rc-1.7.4+97.gceb59bb/system.c Examining data/rc-1.7.4+97.gceb59bb/tree.c Examining data/rc-1.7.4+97.gceb59bb/tripping.c Examining data/rc-1.7.4+97.gceb59bb/utils.c Examining data/rc-1.7.4+97.gceb59bb/var.c Examining data/rc-1.7.4+97.gceb59bb/wait.c Examining data/rc-1.7.4+97.gceb59bb/wait.h Examining data/rc-1.7.4+97.gceb59bb/walk.c Examining data/rc-1.7.4+97.gceb59bb/which.c Examining data/rc-1.7.4+97.gceb59bb/rc.h Examining data/rc-1.7.4+97.gceb59bb/edit-readline.c FINAL RESULTS: data/rc-1.7.4+97.gceb59bb/builtins.c:154: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(path, s->w); data/rc-1.7.4+97.gceb59bb/builtins.c:157:3: [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(path, *av); data/rc-1.7.4+97.gceb59bb/edit-readline.c:69:2: [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(p, a); data/rc-1.7.4+97.gceb59bb/edit-readline.c:72:2: [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(p, b); data/rc-1.7.4+97.gceb59bb/edit-readline.c:129: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(dir_ret, name); data/rc-1.7.4+97.gceb59bb/glom.c:62: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(r->w, s1->w); data/rc-1.7.4+97.gceb59bb/glom.c:63:3: [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(r->w, s2->w); data/rc-1.7.4+97.gceb59bb/glom.c:123:2: [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(f, s->w); data/rc-1.7.4+97.gceb59bb/history.c:88:2: [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(u, s); data/rc-1.7.4+97.gceb59bb/history.c:89:2: [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(u, new); data/rc-1.7.4+97.gceb59bb/history.c:90:2: [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(u, t); data/rc-1.7.4+97.gceb59bb/history.c:342:3: [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(shell, rc_basename(shell), "-c", s, NULL); data/rc-1.7.4+97.gceb59bb/list.c:33: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(r->w, s->w); data/rc-1.7.4+97.gceb59bb/proto.h:46:14: [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). extern char *strcpy(char *, const char *); data/rc-1.7.4+97.gceb59bb/proto.h:48:14: [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). extern char *strcat(char *, const char *); data/rc-1.7.4+97.gceb59bb/rc.h:161: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). #define ecpy(x) strcpy((char *) ealloc(strlen(x) + 1), x) data/rc-1.7.4+97.gceb59bb/rc.h:165:18: [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 ncpy(x) (strcpy((char *) nalloc(strlen(x) + 1), x)) data/rc-1.7.4+97.gceb59bb/tree.c:133:15: [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). n->u[0].s = strcpy((char *) (*alloc)(strlen(s->u[0].s) + 1), s->u[0].s); data/rc-1.7.4+97.gceb59bb/var.c:48:2: [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(new->extdef, extdef); data/rc-1.7.4+97.gceb59bb/which.c:130:4: [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(test, name); data/rc-1.7.4+97.gceb59bb/which.c:132:4: [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(test, path->w); data/rc-1.7.4+97.gceb59bb/which.c:135:4: [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(test, name); data/rc-1.7.4+97.gceb59bb/history.c:201: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 ((history = getenv("history")) == NULL) { data/rc-1.7.4+97.gceb59bb/history.c:336: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. char *shell = getenv("SHELL"); data/rc-1.7.4+97.gceb59bb/addon.c:13:10: [2] (integer) atol: 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). sum += atol(*av); data/rc-1.7.4+97.gceb59bb/addon.c:22:10: [2] (integer) atol: 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). sum *= atol(*av); data/rc-1.7.4+97.gceb59bb/edit-readline.c:132:3: [2] (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). Risk is low because the source is a constant string. strcat(dir_ret, "..."); data/rc-1.7.4+97.gceb59bb/execve.c:17:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pb[256]; /* arbitrary but generous limit */ data/rc-1.7.4+97.gceb59bb/fn.c:110: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 *sig[2]; data/rc-1.7.4+97.gceb59bb/fn.c:123:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *sig[2]; data/rc-1.7.4+97.gceb59bb/footobar.c:286:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *s, old[PRELEN]; data/rc-1.7.4+97.gceb59bb/footobar.c:289:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(old, s -= (PRELEN-1), PRELEN); data/rc-1.7.4+97.gceb59bb/footobar.c:290:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s, PREFIX, PRELEN); data/rc-1.7.4+97.gceb59bb/footobar.c:292:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(s, old, PRELEN); data/rc-1.7.4+97.gceb59bb/glom.c:71: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(r->m, s1->m, x); data/rc-1.7.4+97.gceb59bb/glom.c:75: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(&r->m[x], s2->m, y); data/rc-1.7.4+97.gceb59bb/glom.c:129: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(f, s->w, step); data/rc-1.7.4+97.gceb59bb/glom.c:181:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char isifs[256]; data/rc-1.7.4+97.gceb59bb/glom.c:202:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, r->w, m); data/rc-1.7.4+97.gceb59bb/heredoc.c:39: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(nbuf, buf, (size_t) (t - buf)); \ data/rc-1.7.4+97.gceb59bb/heredoc.c:56:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(t, eof, len); data/rc-1.7.4+97.gceb59bb/heredoc.c:107:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(var, begin, len); data/rc-1.7.4+97.gceb59bb/history.c:205:13: [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). histfile = fopen(history, "r+"); data/rc-1.7.4+97.gceb59bb/input.c:328:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *in[2]; data/rc-1.7.4+97.gceb59bb/main.c:13:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *dashsee[2]; data/rc-1.7.4+97.gceb59bb/main.c:21:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *dollarzero, *null[1]; data/rc-1.7.4+97.gceb59bb/mksignal.c:210:12: [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). outf = fopen("sigmsgs.h", "w"); data/rc-1.7.4+97.gceb59bb/mksignal.c:219:12: [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). outf = fopen("sigmsgs.c", "w"); data/rc-1.7.4+97.gceb59bb/open.c:24:9: [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(name, mode_masks[m], 0666); data/rc-1.7.4+97.gceb59bb/print.c:90:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char number[64], prefix[20]; data/rc-1.7.4+97.gceb59bb/print.c:236: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(format->buf, s, split); data/rc-1.7.4+97.gceb59bb/print.c:242:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(format->buf, s, len); data/rc-1.7.4+97.gceb59bb/print.c:307:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/rc-1.7.4+97.gceb59bb/print.c:339: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(buf, format->bufbegin, used); data/rc-1.7.4+97.gceb59bb/proto.h:50:14: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. extern void *memcpy(void *, const void *, size_t); data/rc-1.7.4+97.gceb59bb/tree.c:137:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(n->u[1].s, s->u[1].s, i); data/rc-1.7.4+97.gceb59bb/builtins.c:151: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). t = strlen(*av) + strlen(s->w) + 2; data/rc-1.7.4+97.gceb59bb/builtins.c:151: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). t = strlen(*av) + strlen(s->w) + 2; data/rc-1.7.4+97.gceb59bb/builtins.c:156:7: [1] (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). Risk is low because the source is a constant character. strcat(path, "/"); data/rc-1.7.4+97.gceb59bb/builtins.c:179:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). i = umask(0); data/rc-1.7.4+97.gceb59bb/builtins.c:180:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(i); data/rc-1.7.4+97.gceb59bb/builtins.c:188:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(i); data/rc-1.7.4+97.gceb59bb/builtins.c:566:12: [1] (buffer) strlen: Does not handle 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(s); data/rc-1.7.4+97.gceb59bb/builtins.c:583: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). if (streq(suf->name, s + len - strlen(suf->name))) { data/rc-1.7.4+97.gceb59bb/builtins.c:584: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). s[len - strlen(suf->name)] = '\0'; data/rc-1.7.4+97.gceb59bb/edit-editline.c:64:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *count = strlen(c->buffer); data/rc-1.7.4+97.gceb59bb/edit-readline.c:32: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). p = r = ealloc(strlen(text) * 2 + 3); data/rc-1.7.4+97.gceb59bb/edit-readline.c:53: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). p = r = ealloc(strlen(text) + 1); data/rc-1.7.4+97.gceb59bb/edit-readline.c:68: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). p = ealloc(strlen(a) + strlen(b) + 2); data/rc-1.7.4+97.gceb59bb/edit-readline.c:68: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). p = ealloc(strlen(a) + strlen(b) + 2); data/rc-1.7.4+97.gceb59bb/edit-readline.c:70:8: [1] (buffer) strlen: Does not handle 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 (p[strlen(p) - 1] != '/') data/rc-1.7.4+97.gceb59bb/edit-readline.c:71:3: [1] (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). Risk is low because the source is a constant character. strcat(p, "/"); data/rc-1.7.4+97.gceb59bb/edit-readline.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). char *dir_ret = ealloc(strlen(name) + 5); data/rc-1.7.4+97.gceb59bb/edit-readline.c:130:3: [1] (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). Risk is low because the source is a constant character. strcat(dir_ret, "/"); data/rc-1.7.4+97.gceb59bb/edit-readline.c:149:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*pre, text, l); data/rc-1.7.4+97.gceb59bb/edit-readline.c:170: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). len = strlen(prefix); data/rc-1.7.4+97.gceb59bb/edit-readline.c:343:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *count = strlen(c->buffer); data/rc-1.7.4+97.gceb59bb/edit-vrl.c:68:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *count = strlen(c->buffer); data/rc-1.7.4+97.gceb59bb/execve.c:23:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, pb, sizeof pb); data/rc-1.7.4+97.gceb59bb/glob.c:9: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 NAMLEN(dirent) strlen((dirent)->d_name) data/rc-1.7.4+97.gceb59bb/glob.c:41: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). if (strspn(p->w, "*") == strlen(p->w) && data/rc-1.7.4+97.gceb59bb/glob.c:42: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). p->m != NULL && strlen(p->m) == strlen(p->w)) data/rc-1.7.4+97.gceb59bb/glob.c:42: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). p->m != NULL && strlen(p->m) == strlen(p->w)) data/rc-1.7.4+97.gceb59bb/glob.c:198: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). if ((psize = strlen(w) + 1) > dsize || dir == NULL) { data/rc-1.7.4+97.gceb59bb/glom.c:58: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). size_t x = strlen(s1->w); data/rc-1.7.4+97.gceb59bb/glom.c:59: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). size_t y = strlen(s2->w); data/rc-1.7.4+97.gceb59bb/glom.c:124: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). f += strlen(s->w); data/rc-1.7.4+97.gceb59bb/glom.c:128: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). step = strlen(s->w); data/rc-1.7.4+97.gceb59bb/hash.c:328: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). len = strlen(text); data/rc-1.7.4+97.gceb59bb/history.c:68: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 plen = strlen(pattern); data/rc-1.7.4+97.gceb59bb/history.c:69: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 tlen = strlen(target); data/rc-1.7.4+97.gceb59bb/history.c:102:12: [1] (buffer) strlen: Does not handle 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 = s + strlen(s); data/rc-1.7.4+97.gceb59bb/history.c:107:11: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getchar(); data/rc-1.7.4+97.gceb59bb/history.c:110:16: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int peekc = getchar(); data/rc-1.7.4+97.gceb59bb/history.c:154:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getchar(); data/rc-1.7.4+97.gceb59bb/input.c:22:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int fd, index, read, ungetcount, lineno, last; data/rc-1.7.4+97.gceb59bb/input.c:233:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). chars_in = istack->read; data/rc-1.7.4+97.gceb59bb/lex.c:128:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: do { data/rc-1.7.4+97.gceb59bb/lex.c:146:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/rc-1.7.4+97.gceb59bb/lex.c:173: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). y->word.m = nalloc(strlen(buf) + 1); data/rc-1.7.4+97.gceb59bb/list.c:32: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). r->w = (*alloc)(strlen(s->w) + 1); data/rc-1.7.4+97.gceb59bb/list.c:46: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). size += strlen(s->w) + 1; data/rc-1.7.4+97.gceb59bb/nonblock.c:11:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). flags = read(0, &flags, 1); data/rc-1.7.4+97.gceb59bb/print.c:60: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(s), width = format->f1 - len; data/rc-1.7.4+97.gceb59bb/print.c:247: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). fmtappend(format, s, strlen(s)); data/rc-1.7.4+97.gceb59bb/proto.h:43: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). extern size_t strlen(const char *); data/rc-1.7.4+97.gceb59bb/proto.h:47:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). extern char *strncpy(char *, const char *, size_t); data/rc-1.7.4+97.gceb59bb/proto.h:49:14: [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. extern char *strncat(char *, const char *, size_t); data/rc-1.7.4+97.gceb59bb/rc.h:161: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). #define ecpy(x) strcpy((char *) ealloc(strlen(x) + 1), x) data/rc-1.7.4+97.gceb59bb/rc.h:165: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). #define ncpy(x) (strcpy((char *) nalloc(strlen(x) + 1), x)) data/rc-1.7.4+97.gceb59bb/rc.h:374:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define rc_read read data/rc-1.7.4+97.gceb59bb/redir.c:36: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). writeall(p[1], fname->w, strlen(fname->w)); data/rc-1.7.4+97.gceb59bb/status.c:138: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). size_t len = strlen(signals[k].name); data/rc-1.7.4+97.gceb59bb/system-bsd.c:39:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, buf, n); data/rc-1.7.4+97.gceb59bb/tree.c:133: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). n->u[0].s = strcpy((char *) (*alloc)(strlen(s->u[0].s) + 1), s->u[0].s); data/rc-1.7.4+97.gceb59bb/tree.c:135: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). size_t i = strlen(s->u[0].s); data/rc-1.7.4+97.gceb59bb/utils.c:41: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). write(2, s, strlen(s)); data/rc-1.7.4+97.gceb59bb/var.c:47: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). new->extdef = ealloc(strlen(extdef) + 1); data/rc-1.7.4+97.gceb59bb/which.c:76: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). int l = strlen(in); data/rc-1.7.4+97.gceb59bb/which.c:122:8: [1] (buffer) strlen: Does not handle 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(name); data/rc-1.7.4+97.gceb59bb/which.c:124:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t need = strlen(path->w) + len + 2; /* one for null terminator, one for the '/' */ data/rc-1.7.4+97.gceb59bb/which.c:134:5: [1] (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). Risk is low because the source is a constant character. strcat(test, "/"); ANALYSIS SUMMARY: Hits = 122 Lines analyzed = 8690 in approximately 0.40 seconds (21934 lines/second) Physical Source Lines of Code (SLOC) = 6967 Hits@level = [0] 21 [1] 66 [2] 32 [3] 2 [4] 22 [5] 0 Hits@level+ = [0+] 143 [1+] 122 [2+] 56 [3+] 24 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 20.5253 [1+] 17.5111 [2+] 8.03789 [3+] 3.44481 [4+] 3.15774 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.