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/rlwrap-0.43/src/completion.c Examining data/rlwrap-0.43/src/filter.c Examining data/rlwrap-0.43/src/main.c Examining data/rlwrap-0.43/src/malloc_debug.c Examining data/rlwrap-0.43/src/malloc_debug.h Examining data/rlwrap-0.43/src/pty.c Examining data/rlwrap-0.43/src/ptytty.c Examining data/rlwrap-0.43/src/readline.c Examining data/rlwrap-0.43/src/redblack.h Examining data/rlwrap-0.43/src/rlwrap.h Examining data/rlwrap-0.43/src/signals.c Examining data/rlwrap-0.43/src/string_utils.c Examining data/rlwrap-0.43/src/term.c Examining data/rlwrap-0.43/src/utils.c FINAL RESULTS: data/rlwrap-0.43/src/utils.c:537:8: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if (readlink(proc_pid_cwd, readlink_buffer, MAXPATHLEN) > 0) data/rlwrap-0.43/src/completion.c:1646:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(copy_for_readline, completion); data/rlwrap-0.43/src/filter.c:137:8: [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. if(execvp(argv[0], argv) < 0) { data/rlwrap-0.43/src/main.c:169:32: [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. if (!isatty(STDIN_FILENO) && execvp(argv[optind], &argv[optind]) < 0) data/rlwrap-0.43/src/main.c:206:9: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (execvp(argv[optind], &argv[optind]) < 0) { data/rlwrap-0.43/src/main.c:598:9: [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(history_filename, F_OK) == 0) { /* already exists, can we read/write it? */ data/rlwrap-0.43/src/main.c:599:11: [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(history_filename, R_OK | W_OK) != 0) { data/rlwrap-0.43/src/main.c:610:10: [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(histdir, W_OK) != 0) { data/rlwrap-0.43/src/main.c:641:7: [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(completion_filename, R_OK) == 0) { data/rlwrap-0.43/src/main.c:643:14: [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. } else if (access(default_completion_filename, R_OK) == 0) { data/rlwrap-0.43/src/main.c:688:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "--%s", longopts[longindex].name); data/rlwrap-0.43/src/ptytty.c:142:11: [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, F_OK) < 0) { data/rlwrap-0.43/src/ptytty.c:147: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/rlwrap-0.43/src/ptytty.c:175:15: [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/rlwrap-0.43/src/readline.c:532:14: [4] (shell) system: 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. if ((ret = system(editor_command4))) { data/rlwrap-0.43/src/rlwrap.h:148:66: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf0(buf,bufsize,format) snprintf(buf,bufsize,format) data/rlwrap-0.43/src/rlwrap.h:149:66: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf1(buf,bufsize,format,arg1) snprintf(buf,bufsize,format,arg1) data/rlwrap-0.43/src/rlwrap.h:150:66: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf2(buf,bufsize,format,arg1,arg2) snprintf(buf,bufsize,format,arg1,arg2) data/rlwrap-0.43/src/rlwrap.h:151:66: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf3(buf,bufsize,format,arg1,arg2,arg3) snprintf(buf,bufsize,format,arg1,arg2,arg3) data/rlwrap-0.43/src/rlwrap.h:152:66: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf4(buf,bufsize,format,arg1,arg2,arg3,arg4) snprintf(buf,bufsize,format,arg1,arg2,arg3,arg4) data/rlwrap-0.43/src/rlwrap.h:153:66: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf5(buf,bufsize,format,arg1,arg2,arg3,arg4,arg5) snprintf(buf,bufsize,format,arg1,arg2,arg3,arg4,arg5) data/rlwrap-0.43/src/rlwrap.h:154:71: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. # define snprintf6(buf,bufsize,format,arg1,arg2,arg3,arg4,arg5,arg6) snprintf(buf,bufsize,format,arg1,arg2,arg3,arg4,arg5,arg6) data/rlwrap-0.43/src/rlwrap.h:157:66: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf0(buf,bufsize,format) sprintf(buf,format) data/rlwrap-0.43/src/rlwrap.h:158:66: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf1(buf,bufsize,format,arg1) sprintf(buf,format,arg1) data/rlwrap-0.43/src/rlwrap.h:159:66: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf2(buf,bufsize,format,arg1,arg2) sprintf(buf,format,arg1,arg2) data/rlwrap-0.43/src/rlwrap.h:160:66: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf3(buf,bufsize,format,arg1,arg2,arg3) sprintf(buf,format,arg1,arg2,arg3) data/rlwrap-0.43/src/rlwrap.h:161:66: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf4(buf,bufsize,format,arg1,arg2,arg3,arg4) sprintf(buf,format,arg1,arg2,arg3,arg4) data/rlwrap-0.43/src/rlwrap.h:162:66: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf5(buf,bufsize,format,arg1,arg2,arg3,arg4,arg5) sprintf(buf,format,arg1,arg2,arg3,arg4,arg5) data/rlwrap-0.43/src/rlwrap.h:163:71: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. # define snprintf6(buf,bufsize,format,arg1,arg2,arg3,arg4,arg5,arg6) sprintf(buf,format,arg1,arg2,arg3,arg4,arg5,arg6) data/rlwrap-0.43/src/rlwrap.h:164:10: [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. # define vsnprintf(buf,bufsize,format,ap) vsprintf(buf,format,ap) data/rlwrap-0.43/src/rlwrap.h:164:66: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. # define vsnprintf(buf,bufsize,format,ap) vsprintf(buf,format,ap) data/rlwrap-0.43/src/rlwrap.h:571:52: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if ((debug & mask) && debug_fp) {WHERE_AND_WHEN; fprintf(debug_fp, format); NL_AND_FLUSH; } data/rlwrap-0.43/src/rlwrap.h:574:52: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if ((debug & mask) && debug_fp) {WHERE_AND_WHEN; fprintf(debug_fp, format, arg); NL_AND_FLUSH; } data/rlwrap-0.43/src/rlwrap.h:577:52: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if ((debug & mask) && debug_fp) {WHERE_AND_WHEN; fprintf(debug_fp, format, arg1, arg2); NL_AND_FLUSH; } data/rlwrap-0.43/src/rlwrap.h:580:52: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if ((debug & mask) && debug_fp) {WHERE_AND_WHEN; fprintf(debug_fp, format, arg1, arg2, arg3); NL_AND_FLUSH; } data/rlwrap-0.43/src/rlwrap.h:583:52: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. if ((debug & mask) && debug_fp) {WHERE_AND_WHEN; fprintf(debug_fp, format, arg1, arg2, arg3,arg4); NL_AND_FLUSH; } data/rlwrap-0.43/src/string_utils.c:944:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(encoded_length, MY_HEX_FORMAT(DIGITS_NUMBER), length); data/rlwrap-0.43/src/utils.c:366: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(contents, sizeof(contents) - 1, message_format, ap); data/rlwrap-0.43/src/utils.c:686:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, format, shortopt, maybe_optional, longopt, longoptional); data/rlwrap-0.43/src/filter.c:114:10: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!getenv("RLWRAP_FILTERDIR")) data/rlwrap-0.43/src/filter.c:116:34: [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. mysetenv("PATH", add3strings(getenv("RLWRAP_FILTERDIR"),":",getenv("PATH"))); data/rlwrap-0.43/src/filter.c:116:65: [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. mysetenv("PATH", add3strings(getenv("RLWRAP_FILTERDIR"),":",getenv("PATH"))); data/rlwrap-0.43/src/main.c:570: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. hostname = getenv("HOSTNAME") ? getenv("HOSTNAME") : "?"; data/rlwrap-0.43/src/main.c:570:35: [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. hostname = getenv("HOSTNAME") ? getenv("HOSTNAME") : "?"; data/rlwrap-0.43/src/main.c:581: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. homedir = (getenv("RLWRAP_HOME") ? getenv("RLWRAP_HOME") : getenv("HOME")); data/rlwrap-0.43/src/main.c:581:38: [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. homedir = (getenv("RLWRAP_HOME") ? getenv("RLWRAP_HOME") : getenv("HOME")); data/rlwrap-0.43/src/main.c:581:62: [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. homedir = (getenv("RLWRAP_HOME") ? getenv("RLWRAP_HOME") : getenv("HOME")); data/rlwrap-0.43/src/main.c:582:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. homedir_prefix = (getenv("RLWRAP_HOME") ? /* is RLWRAP_HOME set? */ data/rlwrap-0.43/src/main.c:583: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. add2strings(getenv("RLWRAP_HOME"), "/") : /* use $RLWRAP_HOME/<command>_history */ data/rlwrap-0.43/src/main.c:584: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. add2strings(getenv("HOME"), "/.")); /* if not, use ~/.<command>_history */ data/rlwrap-0.43/src/main.c:717:9: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long(argc, argv, optstring, longopts, &longindex); data/rlwrap-0.43/src/main.c:719:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt(argc, argv, optstring); data/rlwrap-0.43/src/pty.c:83:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(pid); DEBUG_RANDOM_SLEEP; data/rlwrap-0.43/src/readline.c:517:36: [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. possible_editor_commands = list4(getenv("RLWRAP_EDITOR"), getenv("EDITOR"), getenv("VISUAL"), "vi +%L"); data/rlwrap-0.43/src/readline.c:517:61: [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. possible_editor_commands = list4(getenv("RLWRAP_EDITOR"), getenv("EDITOR"), getenv("VISUAL"), "vi +%L"); data/rlwrap-0.43/src/readline.c:517:79: [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. possible_editor_commands = list4(getenv("RLWRAP_EDITOR"), getenv("EDITOR"), getenv("VISUAL"), "vi +%L"); data/rlwrap-0.43/src/term.c:122:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. term_name = getenv("TERM"); data/rlwrap-0.43/src/utils.c:309:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char **tmpdirs = list4(getenv("TMPDIR"), getenv("TMP"), getenv("TEMP"), "/tmp"); data/rlwrap-0.43/src/utils.c:309:44: [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 **tmpdirs = list4(getenv("TMPDIR"), getenv("TMP"), getenv("TEMP"), "/tmp"); data/rlwrap-0.43/src/utils.c:309:59: [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 **tmpdirs = list4(getenv("TMPDIR"), getenv("TMP"), getenv("TEMP"), "/tmp"); data/rlwrap-0.43/src/completion.c:1502: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[BUFFSIZE]; data/rlwrap-0.43/src/completion.c:1504:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((compl_fp = fopen(completions_file, "r")) == NULL) data/rlwrap-0.43/src/filter.c:181: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 message[MAX_INTERESTING_TAG + 2]; data/rlwrap-0.43/src/main.c:234: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[BUFFSIZE], *timeoutstr, *old_raw_prompt, *new_output_minus_prompt; data/rlwrap-0.43/src/main.c:685: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 buf[BUFFSIZE]; data/rlwrap-0.43/src/main.c:692: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(buf, "-%c", opt); data/rlwrap-0.43/src/main.c:753:18: [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). debug_fp = fopen(DEBUG_FILENAME, "w"); data/rlwrap-0.43/src/malloc_debug.c:52: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 magic[SLOGAN_MAXLEN]; /* magical string that tells us this something about this memory: malloced or freed? */ data/rlwrap-0.43/src/malloc_debug.c:170: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(copy, ptr, size); data/rlwrap-0.43/src/pty.c:115:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ttyfd = open("/dev/tty", O_WRONLY); /* open users terminal */ data/rlwrap-0.43/src/pty.c:347: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 command_wchan[MAXPATHLEN+1]; data/rlwrap-0.43/src/pty.c:351: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[BUFFSIZE]; data/rlwrap-0.43/src/pty.c:363:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). wchan_fd = open(command_wchan, O_RDONLY); data/rlwrap-0.43/src/ptytty.c:70:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tty_name[sizeof "/dev/pts/????\0"]; data/rlwrap-0.43/src/ptytty.c:88:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((pfd = open(ptydev, O_RWNN, 0)) >= 0) { data/rlwrap-0.43/src/ptytty.c:102: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_RWNN, 0); data/rlwrap-0.43/src/ptytty.c:117:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((pfd = open("/dev/ptc", O_RWNN, 0)) >= 0) { data/rlwrap-0.43/src/ptytty.c:124:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((pfd = open("/dev/ptym/clone", O_RWNN, 0)) >= 0) { data/rlwrap-0.43/src/ptytty.c:146:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((pfd = open(pty_name, O_RWNN, 0)) >= 0) { data/rlwrap-0.43/src/ptytty.c:174: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_RWNN, 0)) >= 0) { data/rlwrap-0.43/src/ptytty.c:196: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/rlwrap-0.43/src/ptytty.c:235: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). fd = open("/dev/tty", O_RDWR | O_NOCTTY); data/rlwrap-0.43/src/ptytty.c:247: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). fd = open("/dev/tty", O_RDWR | O_NOCTTY); data/rlwrap-0.43/src/ptytty.c:291: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). fd = open(ttydev, O_RDWR); data/rlwrap-0.43/src/ptytty.c:298: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). fd = open("/dev/tty", O_WRONLY); data/rlwrap-0.43/src/readline.c:573:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). tmpfile_fd = open(tmpfilename, O_RDONLY); data/rlwrap-0.43/src/rlwrap.h:110:30: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define memmove(d, s, n) bcopy ((s), (d), (n)) data/rlwrap-0.43/src/rlwrap.h:561:28: [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. int debug_saved = debug; char file_line[100], when[100]; \ data/rlwrap-0.43/src/string_utils.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 scrap[10], code, *format; data/rlwrap-0.43/src/string_utils.c:458: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(string, buffer, length); data/rlwrap-0.43/src/string_utils.c:954: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 hex_string[DIGITS_NUMBER+1]; data/rlwrap-0.43/src/term.c:359:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). debug_fp = fopen(DEBUG_FILENAME, "w"); data/rlwrap-0.43/src/utils.c:324: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). tmpfile_fd = open(*tmpfile_name, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); data/rlwrap-0.43/src/utils.c:358: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 contents[BUFFSIZE]; data/rlwrap-0.43/src/utils.c:408: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). log_fp = fopen(filename, "a"); data/rlwrap-0.43/src/utils.c:531: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 readlink_buffer[MAXPATHLEN+1]; data/rlwrap-0.43/src/utils.c:878: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((cmdline_fd = open(stored_cmdline_filename, O_RDONLY)) < 1) { data/rlwrap-0.43/src/utils.c:895: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(*rlwrap_command_argv, argv_buffer, cmdline_length); data/rlwrap-0.43/src/completion.c:1645: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). char *copy_for_readline = malloc_foreign(strlen(completion)+1); data/rlwrap-0.43/src/filter.c:203:88: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DPRINTF3(DEBUG_FILTERING, "to filter (%s, %d bytes) %s", tag2description(tag), (int) strlen(buffer), mangle_string_for_debug_log(buffer, MANGLE_LENGTH)); data/rlwrap-0.43/src/filter.c:206:64: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DPRINTF2(DEBUG_FILTERING, "from filter (%d bytes) %s", (int) strlen(filtered), mangle_string_for_debug_log(filtered, MANGLE_LENGTH)); data/rlwrap-0.43/src/filter.c:247: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). (int) strlen(message), mangle_string_for_debug_log(message, MANGLE_LENGTH)); data/rlwrap-0.43/src/filter.c:286: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). uint32_t length32 = strlen(string) + 1; data/rlwrap-0.43/src/main.c:384:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nread = read(master_pty_fd, buf, BUFFSIZE - 1); /* read it */ data/rlwrap-0.43/src/main.c:500:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nread = read(STDIN_FILENO, &byte_read, 1); /* read next byte of input */ data/rlwrap-0.43/src/main.c:531:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (term_eof && byte_read == term_eof && strlen(rl_line_buffer) == 0) { /* hand a term_eof (usually CTRL-D) directly to command */ data/rlwrap-0.43/src/main.c:612:28: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t oldmask = umask(0); data/rlwrap-0.43/src/main.c:615:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(oldmask); data/rlwrap-0.43/src/main.c:770: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). if (strlen(extra_char_after_completion) > 1) data/rlwrap-0.43/src/main.c:889:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (strlen(mybasename(opt_C)) != strlen(opt_C)) /* -C dir/name */ data/rlwrap-0.43/src/main.c:889: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). else if (strlen(mybasename(opt_C)) != strlen(opt_C)) /* -C dir/name */ data/rlwrap-0.43/src/main.c:929: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). (int) strlen(stuff), (int) strlen(output_queue), mangle_string_for_debug_log(stuff, 20)); data/rlwrap-0.43/src/main.c:929: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). (int) strlen(stuff), (int) strlen(output_queue), mangle_string_for_debug_log(stuff, 20)); data/rlwrap-0.43/src/main.c:948: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). queuelen = strlen(output_queue); data/rlwrap-0.43/src/main.c:953:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). assert(nwritten <= (int) strlen(output_queue)); data/rlwrap-0.43/src/malloc_debug.c:98:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(stamp->magic, SLAVERY_SLOGAN, SLOGAN_MAXLEN); data/rlwrap-0.43/src/malloc_debug.c:134:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(stamp->magic, FREEDOM_SLOGAN, SLOGAN_MAXLEN); data/rlwrap-0.43/src/malloc_debug.c:179: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). return copy_and_free_for_malloc_debug(str, strlen(str)+1); data/rlwrap-0.43/src/pty.c:190: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). assert(strlen(saved_rl_state.raw_prompt) < BUFFSIZE); data/rlwrap-0.43/src/pty.c:191:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p = saved_rl_state.raw_prompt + strlen(saved_rl_state.raw_prompt) - 1; data/rlwrap-0.43/src/pty.c:193: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). password_prompt_search_string + strlen(password_prompt_search_string) - data/rlwrap-0.43/src/pty.c:374:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (((nread = read(wchan_fd, buffer, BUFFSIZE -1)) > 0)) { data/rlwrap-0.43/src/ptytty.c:140: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). snprintf1(c1, strlen(c1), "%d", idx); data/rlwrap-0.43/src/ptytty.c:141: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). snprintf1(c2, strlen(c2), "%d", idx); data/rlwrap-0.43/src/readline.c:105: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). saved_rl_state.point = strlen(saved_rl_state.input_buffer); data/rlwrap-0.43/src/readline.c:247:75: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DPRINTF2(DEBUG_READLINE, "putting %d bytes %s in output queue", (int) strlen(rewritten_line), data/rlwrap-0.43/src/readline.c:372:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int promptlen = strlen(prompt_without_ignore_markers); data/rlwrap-0.43/src/readline.c:376:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int total_length = strlen(prompt_plus_line); data/rlwrap-0.43/src/readline.c:565: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). write_patiently(tmpfile_fd, text_to_edit, strlen(text_to_edit), "to temporary file"); data/rlwrap-0.43/src/readline.c:578:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read(tmpfile_fd, input, tmpfilesize); data/rlwrap-0.43/src/readline.c:590: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). rl_delete_text(0, strlen(rl_line_buffer)); data/rlwrap-0.43/src/readline.c:637: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). int length = strlen((*entryp)->line); data/rlwrap-0.43/src/readline.c:638:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(stringp, (*entryp)->line, length); /* copy line, without closing NULL byte; */ data/rlwrap-0.43/src/readline.c:643:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DPRINTF1(DEBUG_READLINE, "stringified %d bytes of history", (int) strlen(big_string)); data/rlwrap-0.43/src/readline.c:688: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). assert(strlen(histpos_as_string) <= MAX_HISTPOS_DIGITS); data/rlwrap-0.43/src/readline.c:710:98: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DPRINTF3(DEBUG_READLINE, "hash=%lx, new_history is %d bytes long, histpos <%s>", hash, (int) strlen(new_history), new_histpos_as_string); data/rlwrap-0.43/src/readline.c:720: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). if ( (length = strlen(new_rl_line_buffer)) > 0 && new_rl_line_buffer[length - 1] == '\n') { data/rlwrap-0.43/src/readline.c:727: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). rl_delete_text(0, strlen(rl_line_buffer)); data/rlwrap-0.43/src/readline.c:730: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). rl_point = strlen(new_rl_line_buffer); data/rlwrap-0.43/src/readline.c:793: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). for (p = prompt_copy + strlen(prompt_copy); p > prompt_copy && *(p-1) == ' '; p--) data/rlwrap-0.43/src/readline.c:915: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). p += strlen(**tcptr); /* p now points 1 char past term control sequence */ data/rlwrap-0.43/src/readline.c:960:66: [1] (buffer) strlen: Does not handle 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_patiently(STDOUT_FILENO,rubbish_from_alternate_screen, strlen(rubbish_from_alternate_screen), "to stdout"); data/rlwrap-0.43/src/rlwrap.h:169: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). # define strnlen(s,l) strlen(s) data/rlwrap-0.43/src/signals.c:330: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). linelength = (within_line_edit ? strlen(rl_line_buffer) : 0) + promptlength; data/rlwrap-0.43/src/string_utils.c:49:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dst, src, size - 1); data/rlwrap-0.43/src/string_utils.c:61:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(dst, src, size - strnlen(dst, size) - 1); data/rlwrap-0.43/src/string_utils.c:90:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return mystrndup(string, strlen(string)); data/rlwrap-0.43/src/string_utils.c:104: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). size = strlen(str1) + strlen(str2) + strlen(str3) + 1; /* total length plus 0 byte */ data/rlwrap-0.43/src/string_utils.c:104:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = strlen(str1) + strlen(str2) + strlen(str3) + 1; /* total length plus 0 byte */ data/rlwrap-0.43/src/string_utils.c:104: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). size = strlen(str1) + strlen(str2) + strlen(str3) + 1; /* total length plus 0 byte */ data/rlwrap-0.43/src/string_utils.c:148: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). for (p = filename + strlen(filename) - 1; p > filename; p--) data/rlwrap-0.43/src/string_utils.c:166: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). for (p = filename + strlen(filename) - 1; p > filename; p--) data/rlwrap-0.43/src/string_utils.c:216:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int count = 0, needle_length = strlen(needle); data/rlwrap-0.43/src/string_utils.c:251:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char **list = mymalloc((1 + strlen(string)) * sizeof(char **)); /* worst case: only delimiters */ data/rlwrap-0.43/src/string_utils.c:327: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). int pattlen = strlen(patt); data/rlwrap-0.43/src/string_utils.c:328: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). int replen = strlen(repl); data/rlwrap-0.43/src/string_utils.c:329:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int stringlen = strlen(string); data/rlwrap-0.43/src/string_utils.c:441: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). total_length += strlen(mangled_char); data/rlwrap-0.43/src/string_utils.c:532: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). if (debug && strlen(buf) != (unsigned int) length) data/rlwrap-0.43/src/string_utils.c:533:87: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). DPRINTF2(DEBUG_TERMIO, "removed %d zero bytes (padding?) from %s", length - (int) strlen(buf), mangle_string_for_debug_log(buf, MANGLE_LENGTH)); data/rlwrap-0.43/src/string_utils.c:633: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). int padsize = (assert(buf != NULL), (3 * strlen(buf) + 1)); /* worst case: every char in buf gets surrounded by RL_PROMPT_{START,END}_IGNORE */ data/rlwrap-0.43/src/string_utils.c:710: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). int length = strlen(str); data/rlwrap-0.43/src/string_utils.c:787: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). line_length = strlen(line_copy); data/rlwrap-0.43/src/string_utils.c:980: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). int length = strlen(field); data/rlwrap-0.43/src/string_utils.c:1027: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). int message_length = strlen(message); data/rlwrap-0.43/src/string_utils.c:1034: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). smallest_message_size = strlen(append_field_and_free_old(NULL, "")); /* this assumes that the empty message is the smallest possible */ data/rlwrap-0.43/src/string_utils.c:1037: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). plist = list = mymalloc(sizeof(char*) * (1 + strlen(message)/smallest_message_size )); /* worst case: "0000000000000000000000" */ data/rlwrap-0.43/src/term.c:135:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!term_name || strlen(term_name)==0) { data/rlwrap-0.43/src/term.c:324: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). int string_length = strlen(string); data/rlwrap-0.43/src/utils.c:199:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((nread = read(fd, (char *) buffer + total_read, count - total_read)) <= 0) { data/rlwrap-0.43/src/utils.c:320: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). tmpfile_fd = mkstemps(*tmpfile_name, strlen(suffix)); /* this will write into *tmpfile_name */ data/rlwrap-0.43/src/utils.c:850: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). argv_len += strlen(argv[i]) + 1; data/rlwrap-0.43/src/utils.c:884:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cmdline_length = read(cmdline_fd, argv_buffer,argv_len); ANALYSIS SUMMARY: Hits = 173 Lines analyzed = 8697 in approximately 0.26 seconds (33422 lines/second) Physical Source Lines of Code (SLOC) = 5857 Hits@level = [0] 36 [1] 75 [2] 38 [3] 21 [4] 38 [5] 1 Hits@level+ = [0+] 209 [1+] 173 [2+] 98 [3+] 60 [4+] 39 [5+] 1 Hits/KSLOC@level+ = [0+] 35.6838 [1+] 29.5373 [2+] 16.7321 [3+] 10.2442 [4+] 6.6587 [5+] 0.170736 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.