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/librep-0.92.7/intl/bindtextdom.c Examining data/librep-0.92.7/intl/cat-compat.c Examining data/librep-0.92.7/intl/dcgettext.c Examining data/librep-0.92.7/intl/dgettext.c Examining data/librep-0.92.7/intl/explodename.c Examining data/librep-0.92.7/intl/finddomain.c Examining data/librep-0.92.7/intl/gettext.c Examining data/librep-0.92.7/intl/gettext.h Examining data/librep-0.92.7/intl/gettextP.h Examining data/librep-0.92.7/intl/hash-string.h Examining data/librep-0.92.7/intl/intl-compat.c Examining data/librep-0.92.7/intl/l10nflist.c Examining data/librep-0.92.7/intl/libgettext.h Examining data/librep-0.92.7/intl/loadinfo.h Examining data/librep-0.92.7/intl/loadmsgcat.c Examining data/librep-0.92.7/intl/localealias.c Examining data/librep-0.92.7/intl/textdomain.c Examining data/librep-0.92.7/src/bytecodes.h Examining data/librep-0.92.7/src/continuations.c Examining data/librep-0.92.7/src/datums.c Examining data/librep-0.92.7/src/debug-buffer.c Examining data/librep-0.92.7/src/ffi.c Examining data/librep-0.92.7/src/files.c Examining data/librep-0.92.7/src/find.c Examining data/librep-0.92.7/src/fluids.c Examining data/librep-0.92.7/src/getpagesize.h Examining data/librep-0.92.7/src/gettext.c Examining data/librep-0.92.7/src/gh.c Examining data/librep-0.92.7/src/lisp.c Examining data/librep-0.92.7/src/lispcmds.c Examining data/librep-0.92.7/src/lispmach.c Examining data/librep-0.92.7/src/lispmach.h Examining data/librep-0.92.7/src/macros.c Examining data/librep-0.92.7/src/main.c Examining data/librep-0.92.7/src/md5.c Examining data/librep-0.92.7/src/md5.h Examining data/librep-0.92.7/src/message.c Examining data/librep-0.92.7/src/numbers.c Examining data/librep-0.92.7/src/origin.c Examining data/librep-0.92.7/src/readline.c Examining data/librep-0.92.7/src/realpath.c Examining data/librep-0.92.7/src/record-profile.c Examining data/librep-0.92.7/src/regexp.c Examining data/librep-0.92.7/src/regsub.c Examining data/librep-0.92.7/src/rep-md5.c Examining data/librep-0.92.7/src/rep-remote.c Examining data/librep-0.92.7/src/rep.c Examining data/librep-0.92.7/src/rep.h Examining data/librep-0.92.7/src/rep_gh.h Examining data/librep-0.92.7/src/rep_lisp.h Examining data/librep-0.92.7/src/rep_regexp.h Examining data/librep-0.92.7/src/rep_subrs.h Examining data/librep-0.92.7/src/repdoc.c Examining data/librep-0.92.7/src/repgdbm.c Examining data/librep-0.92.7/src/repint.h Examining data/librep-0.92.7/src/repint_subrs.h Examining data/librep-0.92.7/src/repsdbm.c Examining data/librep-0.92.7/src/safemach.c Examining data/librep-0.92.7/src/sdbm.c Examining data/librep-0.92.7/src/sdbm.h Examining data/librep-0.92.7/src/sdbm_hash.c Examining data/librep-0.92.7/src/sdbm_pair.c Examining data/librep-0.92.7/src/sdbm_pair.h Examining data/librep-0.92.7/src/sdbm_tune.h Examining data/librep-0.92.7/src/sockets.c Examining data/librep-0.92.7/src/streams.c Examining data/librep-0.92.7/src/structures.c Examining data/librep-0.92.7/src/symbols.c Examining data/librep-0.92.7/src/tables.c Examining data/librep-0.92.7/src/timers.c Examining data/librep-0.92.7/src/tuples.c Examining data/librep-0.92.7/src/unix_defs.h Examining data/librep-0.92.7/src/unix_dl.c Examining data/librep-0.92.7/src/unix_files.c Examining data/librep-0.92.7/src/unix_main.c Examining data/librep-0.92.7/src/unix_processes.c Examining data/librep-0.92.7/src/utf8.c Examining data/librep-0.92.7/src/values.c Examining data/librep-0.92.7/src/weak-refs.c Examining data/librep-0.92.7/src/misc.c FINAL RESULTS: data/librep-0.92.7/src/realpath.c:174:12: [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. n = readlink (rpath, buf, path_max); data/librep-0.92.7/src/rep-remote.c:359:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(argv[1], statb.st_mode); data/librep-0.92.7/src/rep-remote.c:387:9: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod (argv[0], mode) == 0) data/librep-0.92.7/src/rep-remote.c:399:14: [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. length = readlink (argv[0], buf, sizeof (buf)); data/librep-0.92.7/src/unix_files.c:341:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(rep_STR(dst), statb.st_mode); data/librep-0.92.7/src/unix_files.c:488:8: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if(chmod(rep_STR(file), rep_INT(modes)) == 0) data/librep-0.92.7/src/unix_files.c:575:15: [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. int len = readlink (rep_STR(file), buf, sizeof (buf)); data/librep-0.92.7/intl/cat-compat.c:111: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 (new_name, PACKAGE); data/librep-0.92.7/intl/cat-compat.c:117:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang, data/librep-0.92.7/src/continuations.c:133:16: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DB(x) printf x data/librep-0.92.7/src/debug-buffer.c:88:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, sizeof(buf), fmt, args); data/librep-0.92.7/src/debug-buffer.c:90:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buf, fmt, args); data/librep-0.92.7/src/lisp.c:797:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "Expecting `%s'", str - 1); data/librep-0.92.7/src/lisp.c:2227:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tbuf, "#<subr %s>", rep_STR(rep_XSUBR(obj)->name)); data/librep-0.92.7/src/lisp.c:2237:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tbuf, "#<special-form %s>", rep_STR(rep_XSUBR(obj)->name)); data/librep-0.92.7/src/lisp.c:2749:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, " at %s:%ld", data/librep-0.92.7/src/message.c:57:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, msg, args); data/librep-0.92.7/src/misc.c:579:14: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. output = crypt (rep_STR (key), rep_STR (salt)); data/librep-0.92.7/src/numbers.c:1124:6: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, sizeof(buf), tem, rep_INT(obj)); data/librep-0.92.7/src/numbers.c:1126:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, tem, rep_INT(obj)); data/librep-0.92.7/src/numbers.c:1178:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, sizeof(buf), fmt, rep_NUMBER(obj,f)); data/librep-0.92.7/src/numbers.c:1180:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, fmt, rep_NUMBER(obj,f)); data/librep-0.92.7/src/readline.c:237:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(history_file, "%s/.rep_history",getenv("HOME")); data/librep-0.92.7/src/realpath.c:189:8: [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 (buf, end); data/librep-0.92.7/src/realpath.c:190:8: [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 (extra_buf, buf); data/librep-0.92.7/src/realpath.c:208:21: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). return resolved ? strcpy (resolved, rpath) : rpath; data/librep-0.92.7/src/realpath.c:212: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 (resolved, rpath); data/librep-0.92.7/src/regexp.c:1388:9: [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). (void) strcat(buf, p); data/librep-0.92.7/src/rep-remote.c:84:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, fmt, args); data/librep-0.92.7/src/rep-remote.c:430: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 (dirname, argv[0]); data/librep-0.92.7/src/rep-remote.c:444:6: [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 (nambuf, dirname); data/librep-0.92.7/src/rep-remote.c:445:6: [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 (nambuf, de->d_name); data/librep-0.92.7/src/rep-remote.c:450:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf (ptr, " %ld (%ld . %ld) %s %ld \"", data/librep-0.92.7/src/rep-remote.c:463:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf (ptr, "\" %d \"%s\" \"%s\"]\n", data/librep-0.92.7/src/repgdbm.c:24: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. repv access; data/librep-0.92.7/src/repgdbm.c:195:32: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. rep_MARKVAL (rep_DBM(val)->access); data/librep-0.92.7/src/repsdbm.c:24: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. repv access; data/librep-0.92.7/src/repsdbm.c:203:32: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. rep_MARKVAL (rep_DBM(val)->access); data/librep-0.92.7/src/sdbm.c:90:12: [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). dirname = strcat(strcpy(dirname, file), DIRFEXT); data/librep-0.92.7/src/sdbm.c:90: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). dirname = strcat(strcpy(dirname, file), DIRFEXT); data/librep-0.92.7/src/sdbm.c:91:12: [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). pagname = strcpy(dirname + strlen(dirname) + 1, file); data/librep-0.92.7/src/sdbm.c:92:12: [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). pagname = strcat(pagname, PAGFEXT); data/librep-0.92.7/src/sdbm_tune.h:31:18: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define debug(x) printf x data/librep-0.92.7/src/sockets.c:47:16: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DB(x) printf x data/librep-0.92.7/src/structures.c:1652:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buf, "documentation#%s", rep_STR (name)); data/librep-0.92.7/src/unix_dl.c:157: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 (tem + 1, sym); data/librep-0.92.7/src/unix_dl.c:274: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 (name, ptr); data/librep-0.92.7/src/unix_dl.c:283: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(name + (base - rep_STR(file_name)), ptr); data/librep-0.92.7/src/unix_dl.c:331:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (err, "Can't find dlname in %s", rep_STR (file_name)); data/librep-0.92.7/src/unix_files.c:372:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access(rep_STR(file), R_OK) == 0 ? Qt : Qnil; data/librep-0.92.7/src/unix_files.c:378:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access(rep_STR(file), W_OK) == 0 ? Qt : Qnil; data/librep-0.92.7/src/unix_files.c:384:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access(rep_STR(file), X_OK) == 0 ? Qt : Qnil; data/librep-0.92.7/src/unix_files.c:390:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access(rep_STR(file), F_OK) == 0 ? Qt : Qnil; data/librep-0.92.7/src/unix_main.c:129:16: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. if(!(tmp = getlogin())) data/librep-0.92.7/src/unix_processes.c:144:16: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define DB(x) fprintf x data/librep-0.92.7/src/unix_processes.c:487:6: [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(slavenam, tem); data/librep-0.92.7/src/unix_processes.c:511:6: [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(slavenam, R_OK | W_OK) == 0) data/librep-0.92.7/src/unix_processes.c:737:3: [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], argv); data/librep-0.92.7/intl/cat-compat.c:28:7: [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 *getenv (); data/librep-0.92.7/intl/cat-compat.c:84: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. lang = getenv ("LC_ALL"); data/librep-0.92.7/intl/cat-compat.c:87: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. lang = getenv ("LC_MESSAGES"); data/librep-0.92.7/intl/cat-compat.c:89:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. lang = getenv ("LANG"); data/librep-0.92.7/intl/cat-compat.c:159: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. old_val = getenv ("NLSPATH"); data/librep-0.92.7/intl/dcgettext.c:52:7: [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 *getenv (); data/librep-0.92.7/intl/dcgettext.c:99:7: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. char *getwd (); data/librep-0.92.7/intl/dcgettext.c:100:28: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. # define getcwd(buf, max) getwd (buf) data/librep-0.92.7/intl/dcgettext.c:552:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. retval = getenv ("LANGUAGE"); data/librep-0.92.7/intl/dcgettext.c:563:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. retval = getenv ("LC_ALL"); data/librep-0.92.7/intl/dcgettext.c:568:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. retval = getenv (categoryname); data/librep-0.92.7/intl/dcgettext.c:573:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. retval = getenv ("LANG"); data/librep-0.92.7/intl/localealias.c:47:7: [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 *getenv (); data/librep-0.92.7/src/files.c:1656:8: [3] (tmpfile) tmpnam: Temporary file race condition (CWE-377). if(tmpnam(buf)) data/librep-0.92.7/src/lispcmds.c:2010:11: [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. ptr = getenv (env); data/librep-0.92.7/src/lispcmds.c:2117:8: [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("REPDIR") != 0) data/librep-0.92.7/src/lispcmds.c:2118:39: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Fset (Qrep_directory, rep_string_dup(getenv("REPDIR"))); data/librep-0.92.7/src/lispcmds.c:2123:8: [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("REPLISPDIR") != 0) data/librep-0.92.7/src/lispcmds.c:2124: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. Fset (Qlisp_lib_directory, rep_string_dup(getenv("REPLISPDIR"))); data/librep-0.92.7/src/lispcmds.c:2129:8: [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("REPSITELISPDIR") != 0) data/librep-0.92.7/src/lispcmds.c:2130: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. Fset(Qsite_lisp_directory, rep_string_dup(getenv("REPSITELISPDIR"))); data/librep-0.92.7/src/lispcmds.c:2137:8: [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("REPEXECDIR") != 0) data/librep-0.92.7/src/lispcmds.c:2138:40: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Fset (Qexec_directory, rep_string_dup(getenv("REPEXECDIR"))); data/librep-0.92.7/src/lispcmds.c:2143:8: [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("REPDOCFILE") != 0) data/librep-0.92.7/src/lispcmds.c:2144: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. Fset (Qdocumentation_file, rep_string_dup(getenv("REPDOCFILE"))); data/librep-0.92.7/src/main.c:206: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. char *dump_file = getenv ("REPDUMPFILE"); data/librep-0.92.7/src/main.c:232: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. char *tem = getenv ("REPUNDUMPED"); data/librep-0.92.7/src/numbers.c:2965:15: [3] (random) lrand48: 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. # define rand lrand48 data/librep-0.92.7/src/numbers.c:2966:10: [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. # define srand srand48 data/librep-0.92.7/src/numbers.c:2980: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 (seed); data/librep-0.92.7/src/readline.c:233: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. if (isatty (0) && getenv("HOME")) data/librep-0.92.7/src/readline.c:235:49: [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. history_file=(char*) malloc((uint) strlen(getenv("HOME")) + (uint) strlen("/.rep_history") +2); data/librep-0.92.7/src/readline.c:237:48: [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. sprintf(history_file, "%s/.rep_history",getenv("HOME")); data/librep-0.92.7/src/realpath.c:79:1: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. realpath (const char *name, char *resolved) data/librep-0.92.7/src/realpath.c:102:12: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. if (!getwd (rpath)) data/librep-0.92.7/src/repint_subrs.h:242:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. extern char *realpath (const char *name, char *resolved); data/librep-0.92.7/src/unix_files.c:214:8: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(realpath(rep_STR(file), buf) == 0) data/librep-0.92.7/src/unix_files.c:598:9: [3] (buffer) getwd: This does not protect against buffer overflows by itself, so use with caution (CWE-120, CWE-20). Use getcwd instead. if(!getwd(buf)) data/librep-0.92.7/src/unix_main.c:180:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. src = getenv("HOME"); data/librep-0.92.7/intl/bindtextdom.c:36: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. # ifndef memcpy data/librep-0.92.7/intl/bindtextdom.c:37: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. # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/bindtextdom.c:37:33: [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 memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/bindtextdom.c:125:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (new_dirname, dirname, len); data/librep-0.92.7/intl/bindtextdom.c:156: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 (new_binding->domainname, domainname, len); data/librep-0.92.7/intl/bindtextdom.c:172: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 (new_binding->dirname, dirname, len); data/librep-0.92.7/intl/finddomain.c:42: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. # ifndef memcpy data/librep-0.92.7/intl/finddomain.c:43: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. # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/finddomain.c:43:33: [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 memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/finddomain.c:156: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 (locale, alias_value, len); data/librep-0.92.7/intl/l10nflist.c:31: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. # ifndef memcpy data/librep-0.92.7/intl/l10nflist.c:32: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. # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/l10nflist.c:32:33: [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 memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/l10nflist.c:226: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 (abs_filename, dirlist, dirlist_len); data/librep-0.92.7/intl/loadmsgcat.c:47: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). # define open __open data/librep-0.92.7/intl/loadmsgcat.c:88: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 (domain_file->filename, O_RDONLY); data/librep-0.92.7/intl/localealias.c:62: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. # ifndef memcpy data/librep-0.92.7/intl/localealias.c:63: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. # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/localealias.c:63:33: [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 memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/localealias.c:234: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 (full_fname, fname, fname_len); data/librep-0.92.7/intl/localealias.c:235: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 (&full_fname[fname_len], aliasfile, sizeof aliasfile); data/librep-0.92.7/intl/localealias.c:238:8: [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). fp = fopen (full_fname, "r"); data/librep-0.92.7/intl/localealias.c:253: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[BUFSIZ]; data/librep-0.92.7/intl/localealias.c:266:4: [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 altbuf[BUFSIZ]; data/librep-0.92.7/intl/localealias.c:336:26: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. map[nmap].alias = memcpy (&string_space[string_space_act], data/librep-0.92.7/intl/localealias.c:340:26: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. map[nmap].value = memcpy (&string_space[string_space_act], data/librep-0.92.7/intl/textdomain.c:31: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. # ifndef memcpy data/librep-0.92.7/intl/textdomain.c:32: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. # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/textdomain.c:32:33: [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 memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) data/librep-0.92.7/intl/textdomain.c:94: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 (cp, domainname, len); data/librep-0.92.7/src/continuations.c:494: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 (c->stack_copy, c->stack_top, c->real_size); data/librep-0.92.7/src/continuations.c:496: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 (c->stack_copy, c->stack_bottom, c->real_size); data/librep-0.92.7/src/continuations.c:505: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. volatile char growth[STACK_GROWTH]; data/librep-0.92.7/src/continuations.c:523: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 (c->stack_top, c->stack_copy, c->real_size); data/librep-0.92.7/src/continuations.c:525: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 (c->stack_bottom, c->stack_copy, c->real_size); data/librep-0.92.7/src/debug-buffer.c:37: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 data[1]; data/librep-0.92.7/src/debug-buffer.c:83:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/librep-0.92.7/src/debug-buffer.c:97: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(db->data + db->ptr, buf, before); data/librep-0.92.7/src/debug-buffer.c:98: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(db->data, buf + before, after); data/librep-0.92.7/src/debug-buffer.c:104: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(db->data + db->ptr, buf, length); data/librep-0.92.7/src/debug-buffer.c:164:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((char *)stack[i]) - ((char *)addr)); data/librep-0.92.7/src/files.c:840:32: [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). rep_FILE(file)->file.fh = fopen(rep_STR(file_name), data/librep-0.92.7/src/files.c:1655:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[L_tmpnam]; data/librep-0.92.7/src/find.c:251: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(&sd->matches, &last_matches, sizeof(rep_regsubs)); data/librep-0.92.7/src/find.c:263:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&last_matches, &sd->matches, sizeof(rep_regsubs)); data/librep-0.92.7/src/find.c:463:6: [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(newbuf, buf, i); data/librep-0.92.7/src/gh.c:284: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 (buf, rep_STR (str), len); data/librep-0.92.7/src/gh.c:299: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 (dst, rep_STR (src) + start, len); data/librep-0.92.7/src/lisp.c:448:6: [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 (rep_STR (new), buf, buflen / 2); data/librep-0.92.7/src/lisp.c:745: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(newbuf, buf, cur - buf); data/librep-0.92.7/src/lisp.c:793:6: [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/librep-0.92.7/src/lisp.c:2150: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 tbuf[40]; data/librep-0.92.7/src/lisp.c:2255:6: [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 (tbuf, "%" rep_PTR_SIZED_INT_CONV "x", obj); data/librep-0.92.7/src/lisp.c:2298:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; data/librep-0.92.7/src/lisp.c:2721:6: [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[16]; data/librep-0.92.7/src/lisp.c:2723:6: [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, "#%-3d ", i); data/librep-0.92.7/src/lisp.c:2743: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[256]; data/librep-0.92.7/src/lispcmds.c:819: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 (rep_VECT (vec)->array, argv, argc * sizeof (repv)); data/librep-0.92.7/src/lispcmds.c:878:17: [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 *)rep_STR(array))[rep_INT(index)] = (unsigned char)rep_INT(new); data/librep-0.92.7/src/lispcmds.c:912: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. return(rep_MAKE_INT(((unsigned char *)rep_STR(array))[rep_INT(index)])); data/librep-0.92.7/src/lispcmds.c:1054: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 (ptr, rep_STR (elt), rep_STRING_LEN (elt)); data/librep-0.92.7/src/main.c:233:28: [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 (dump_file && (!tem || atoi(tem) == 0)) data/librep-0.92.7/src/md5.c:34: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. # define memcpy(d, s, n) bcopy ((s), (d), (n)) data/librep-0.92.7/src/md5.c:34:27: [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 memcpy(d, s, n) bcopy ((s), (d), (n)) data/librep-0.92.7/src/md5.c:57: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. static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; data/librep-0.92.7/src/md5.c:113: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 (&ctx->buffer[bytes], fillbuf, pad); data/librep-0.92.7/src/md5.c:137: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[BLOCKSIZE + 72]; data/librep-0.92.7/src/md5.c:218: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 (&ctx->buffer[left_over], buffer, add); data/librep-0.92.7/src/md5.c:225: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 (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], data/librep-0.92.7/src/md5.c:245: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 (ctx->buffer, buffer, len); data/librep-0.92.7/src/md5.h:90: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[128]; data/librep-0.92.7/src/misc.c:130: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(new, old, len); data/librep-0.92.7/src/misc.c:276: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[256]; data/librep-0.92.7/src/misc.c:435: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. *str++ = (c < tablen) ? ((unsigned char *)rep_STR(table))[c] : c; data/librep-0.92.7/src/misc.c:650:17: [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 *)rep_STR(up))[i] = toupper(i); data/librep-0.92.7/src/misc.c:651:17: [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 *)rep_STR(down))[i] = tolower(i); data/librep-0.92.7/src/misc.c:666:17: [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 *)rep_STR(flatten))[i] = i; data/librep-0.92.7/src/numbers.c:899:6: [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, tem, len); \ data/librep-0.92.7/src/numbers.c:987:6: [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, buf, len); data/librep-0.92.7/src/numbers.c:1002: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, buf, len); data/librep-0.92.7/src/numbers.c:1048: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 (copy, buf, tem - buf); data/librep-0.92.7/src/numbers.c:1106: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[128], fmt[8], *tem, *old_locale; data/librep-0.92.7/src/numbers.c:1173:2: [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 (fmt, "%%.%dg", prec < 0 ? 16 : prec); data/librep-0.92.7/src/numbers.c:1199: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[64]; data/librep-0.92.7/src/numbers.c:1204:2: [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, "%" rep_PTR_SIZED_INT_CONV "d", rep_INT(obj)); data/librep-0.92.7/src/readline.c:198: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 (rep_STR(ret), input, len); data/librep-0.92.7/src/realpath.c:157: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 (dest, start, end - start); data/librep-0.92.7/src/regexp.c:692:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char mat[3] = "xX"; data/librep-0.92.7/src/regexp.c:1287:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[50]; data/librep-0.92.7/src/regexp.c:1331:2: [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 + strlen(buf), "OPEN%d", OP(op) - OPEN); data/librep-0.92.7/src/regexp.c:1343:2: [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 + strlen(buf), "CLOSE%d", OP(op) - CLOSE); data/librep-0.92.7/src/rep-md5.c:31:17: [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. digest_to_repv (char digest[16]) data/librep-0.92.7/src/rep-md5.c:33:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char hex_digits[16] = "0123456789abcdef"; data/librep-0.92.7/src/rep-md5.c:34:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hex_digest[32]; data/librep-0.92.7/src/rep-md5.c:60: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 digest[16]; data/librep-0.92.7/src/rep-md5.c:81: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 digest[16]; data/librep-0.92.7/src/rep-md5.c:85:10: [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). fh = fopen (rep_STR (file), "r"); data/librep-0.92.7/src/rep-remote.c:109: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 lbuf[10]; data/librep-0.92.7/src/rep-remote.c:110:5: [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 (lbuf, "%08lx", value); data/librep-0.92.7/src/rep-remote.c:118: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 lbuf[10]; data/librep-0.92.7/src/rep-remote.c:230: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. static char extra_bits[3] = { 'S', 'S', 'T' }; data/librep-0.92.7/src/rep-remote.c:251: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). FILE *fh = fopen (argv[0], "r"); data/librep-0.92.7/src/rep-remote.c:259: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[BUFSIZ]; data/librep-0.92.7/src/rep-remote.c:282:10: [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). fh = fopen (argv[0], "w"); data/librep-0.92.7/src/rep-remote.c:289:6: [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[BUFSIZ]; data/librep-0.92.7/src/rep-remote.c:350: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). srcf = open(argv[0], O_RDONLY); data/librep-0.92.7/src/rep-remote.c:353: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). int dstf = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0666); data/librep-0.92.7/src/rep-remote.c:361: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[BUFSIZ]; data/librep-0.92.7/src/rep-remote.c:396:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/librep-0.92.7/src/rep-remote.c:429: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 dirname[PATH_MAX]; data/librep-0.92.7/src/rep-remote.c:441:6: [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 nambuf[PATH_MAX]; data/librep-0.92.7/src/rep-remote.c:443:6: [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[3*PATH_MAX], *ptr = buf; data/librep-0.92.7/src/rep-remote.c:485:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/librep-0.92.7/src/rep-remote.c:486:5: [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, "\002rep-remote; protocol %d\002\001", PROTOCOL_VERSION); data/librep-0.92.7/src/rep-remote.c:509: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 *args[64]; data/librep-0.92.7/src/rep_regexp.h:20: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 *startp[rep_NSUBEXP]; data/librep-0.92.7/src/rep_regexp.h: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 *endp[rep_NSUBEXP]; data/librep-0.92.7/src/rep_regexp.h:38: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 program[1]; /* Unwarranted chumminess with compiler. */ data/librep-0.92.7/src/repdoc.c:41:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/librep-0.92.7/src/repdoc.c:48:6: [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[16384]; /* so lazy.. */ data/librep-0.92.7/src/repdoc.c:100: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). FILE *file = fopen(*av, "r"); data/librep-0.92.7/src/sdbm.c:130: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 ((db->pagf = open(pagname, flags, mode)) > -1) { data/librep-0.92.7/src/sdbm.c:131: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). if ((db->dirf = open(dirname, flags, mode)) > -1) { data/librep-0.92.7/src/sdbm.c:281: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 twin[PBLKSIZ]; data/librep-0.92.7/src/sdbm.c:309: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. (void) memcpy(pag, new, PBLKSIZ); data/librep-0.92.7/src/sdbm.h:26: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 pagbuf[PBLKSIZ]; /* page file block buffer */ data/librep-0.92.7/src/sdbm.h:28: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 dirbuf[DBLKSIZ]; /* directory file block buffer */ data/librep-0.92.7/src/sdbm_pair.c:79:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(pag + off, key.dptr, key.dsize); data/librep-0.92.7/src/sdbm_pair.c:85:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(pag + off, val.dptr, val.dsize); data/librep-0.92.7/src/sdbm_pair.c:249: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 cur[PBLKSIZ]; data/librep-0.92.7/src/sdbm_pair.c:252:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(cur, pag, PBLKSIZ); data/librep-0.92.7/src/sdbm_tune.h:16:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define memcpy(s1,s2,n) bcopy(s2, s1, n) data/librep-0.92.7/src/sdbm_tune.h:16:25: [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 memcpy(s1,s2,n) bcopy(s2, s1, n) data/librep-0.92.7/src/sockets.c:169:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1025]; data/librep-0.92.7/src/sockets.c:500: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 hname[128]; data/librep-0.92.7/src/streams.c:95:24: [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. c = (int) ((unsigned char *)rep_STR(rep_CDR(stream)))[rep_INT(res)]; data/librep-0.92.7/src/streams.c:226: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 tmps[2]; data/librep-0.92.7/src/streams.c:242: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 (rep_STR (new), rep_STR (args), len); data/librep-0.92.7/src/streams.c:247:17: [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 *)rep_STR (args))[len] = (unsigned char) c; data/librep-0.92.7/src/streams.c:359: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 (rep_STR (new), rep_STR (args), len); data/librep-0.92.7/src/streams.c:364:6: [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 (rep_STR (args) + len, buf, bufLen); data/librep-0.92.7/src/streams.c:719:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ+1]; data/librep-0.92.7/src/streams.c:933:13: [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). arg = atoi (fmt); data/librep-0.92.7/src/streams.c:1008: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[256], *ptr; data/librep-0.92.7/src/symbols.c:1106:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[20]; data/librep-0.92.7/src/symbols.c:1111:5: [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, "G%04d", counter); data/librep-0.92.7/src/symbols.c:1411: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 (rep_STR (str) + 2, rep_STR (name), name_len); data/librep-0.92.7/src/timers.c:347:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/librep-0.92.7/src/timers.c:352:5: [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, "#<timer %lds, %ldms>", TIMER(arg)->secs, TIMER(arg)->msecs); data/librep-0.92.7/src/unix_dl.c:247: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[256]; data/librep-0.92.7/src/unix_dl.c:250:7: [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). fh = fopen(rep_STR(file_name), "r"); data/librep-0.92.7/src/unix_dl.c:281: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(name, rep_STR(file_name), data/librep-0.92.7/src/unix_dl.c:306: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 (string, ptr, end - ptr); data/librep-0.92.7/src/unix_dl.c:327: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 err[256]; data/librep-0.92.7/src/unix_files.c:111:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/librep-0.92.7/src/unix_files.c:184: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(optr, iptr, end - iptr); data/librep-0.92.7/src/unix_files.c:211:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/librep-0.92.7/src/unix_files.c:332: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). srcf = open(rep_STR(src), O_RDONLY); data/librep-0.92.7/src/unix_files.c:335: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). int dstf = open(rep_STR(dst), O_WRONLY | O_CREAT | O_TRUNC, 0666); data/librep-0.92.7/src/unix_files.c:343: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[BUFSIZ]; data/librep-0.92.7/src/unix_files.c:521: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 extra_bits[3] = { 'S', 'S', 'T' }; data/librep-0.92.7/src/unix_files.c:574:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/librep-0.92.7/src/unix_files.c:594:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/librep-0.92.7/src/unix_main.c:219:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/librep-0.92.7/src/unix_main.c:429:6: [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(inputs, &out, sizeof(out)); data/librep-0.92.7/src/unix_main.c:477: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 (inputs, ©, sizeof (copy)); data/librep-0.92.7/src/unix_processes.c:337:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1025]; data/librep-0.92.7/src/unix_processes.c:478: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). master = open("/dev/ptmx", O_RDWR); data/librep-0.92.7/src/unix_processes.c:505:6: [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(slavenam, "/dev/pty%c%x", c, i); data/librep-0.92.7/src/unix_processes.c:508: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). if((master = open(slavenam, O_RDWR)) >= 0) data/librep-0.92.7/src/unix_processes.c:564: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 slavenam[32]; data/librep-0.92.7/src/unix_processes.c:578: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). stdin_fds[0] = open(sync_input, O_RDONLY); data/librep-0.92.7/src/unix_processes.c:630: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). pty_slave_fd = open(slavenam, O_RDWR); data/librep-0.92.7/src/unix_processes.c:817: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[1025]; data/librep-0.92.7/src/unix_processes.c:1031:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[40]; data/librep-0.92.7/src/unix_processes.c:1050:6: [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, " exited: 0x%x", pr->pr_ExitStatus); data/librep-0.92.7/src/unix_processes.c:1061: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 tmps[2]; data/librep-0.92.7/src/unix_processes.c:2009: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 *argv[4]; data/librep-0.92.7/src/utf8.c:33: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. static const char utf8_skip_data[256] = { data/librep-0.92.7/src/values.c:286: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(rep_STR(dst), src, slen); data/librep-0.92.7/intl/bindtextdom.c:120: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). size_t len = strlen (dirname) + 1; data/librep-0.92.7/intl/bindtextdom.c:152: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). len = strlen (domainname) + 1; data/librep-0.92.7/intl/bindtextdom.c:168: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). len = strlen (dirname) + 1; data/librep-0.92.7/intl/cat-compat.c:103: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). new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang) data/librep-0.92.7/intl/cat-compat.c:156:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname) data/librep-0.92.7/intl/cat-compat.c:167: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). new_val_len += strlen (old_val); data/librep-0.92.7/intl/dcgettext.c:272: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). size_t dirname_len = strlen (binding->dirname) + 1; data/librep-0.92.7/intl/dcgettext.c:307: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). xdomainname = (char *) alloca (strlen (categoryname) data/librep-0.92.7/intl/dcgettext.c:308: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). + strlen (domainname) + 5); data/librep-0.92.7/intl/dcgettext.c:316: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). single_locale = (char *) alloca (strlen (categoryvalue) + 1); data/librep-0.92.7/intl/dcgettext.c:414: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). nls_uint32 len = strlen (msgid); data/librep-0.92.7/intl/finddomain.c:115: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). strlen (dirname) + 1, 0, locale, NULL, NULL, data/librep-0.92.7/intl/finddomain.c:151: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). size_t len = strlen (alias_value) + 1; data/librep-0.92.7/intl/finddomain.c:170: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). strlen (dirname) + 1, mask, language, territory, data/librep-0.92.7/intl/l10nflist.c:91:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t part_len = strlen (argz); data/librep-0.92.7/intl/l10nflist.c:115:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t part_len = strlen (argz); data/librep-0.92.7/intl/l10nflist.c:199: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). + strlen (language) data/librep-0.92.7/intl/l10nflist.c:201: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). ? strlen (territory) + 1 : 0) data/librep-0.92.7/intl/l10nflist.c:203: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). ? strlen (codeset) + 1 : 0) data/librep-0.92.7/intl/l10nflist.c:205: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). ? strlen (normalized_codeset) + 1 : 0) data/librep-0.92.7/intl/l10nflist.c:208: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). ? strlen (modifier) + 1 : 0) data/librep-0.92.7/intl/l10nflist.c:210: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). ? strlen (special) + 1 : 0) data/librep-0.92.7/intl/l10nflist.c:214:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ? strlen (sponsor) + 1 : 0) data/librep-0.92.7/intl/l10nflist.c:216: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). ? strlen (revision) + 1 : 0)) : 0) data/librep-0.92.7/intl/l10nflist.c:217: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). + 1 + strlen (filename) + 1); data/librep-0.92.7/intl/l10nflist.c:340: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). = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, data/librep-0.92.7/intl/loadmsgcat.c:49:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define read __read data/librep-0.92.7/intl/loadmsgcat.c:132:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). long int nb = (long int) read (fd, read_ptr, to_read); data/librep-0.92.7/intl/localealias.c:317: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). alias_len = strlen (alias) + 1; data/librep-0.92.7/intl/localealias.c:318: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). value_len = strlen (value) + 1; data/librep-0.92.7/intl/textdomain.c:91: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). size_t len = strlen (domainname) + 1; data/librep-0.92.7/src/debug-buffer.c:92: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). length = strlen(buf); data/librep-0.92.7/src/files.c:150:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). DEFSYM(read, "read"); data/librep-0.92.7/src/files.c:1731:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rep_INTERN(read); rep_INTERN(write); rep_INTERN(append); data/librep-0.92.7/src/lisp.c:230:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc (rep_FILE (stream)->file.fh); data/librep-0.92.7/src/main.c:82: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 optlen = strlen(option); data/librep-0.92.7/src/misc.c:204: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). matchlen = strlen(tmp); data/librep-0.92.7/src/misc.c:287: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). return rep_string_dupn(str, strlen(str) - 1); data/librep-0.92.7/src/numbers.c:897: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 len = strlen (tem); \ data/librep-0.92.7/src/numbers.c:1165: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 (out); data/librep-0.92.7/src/numbers.c:1188:6: [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 (buf, "."); data/librep-0.92.7/src/numbers.c:2912: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). return rep_box_string (out, strlen (out)); data/librep-0.92.7/src/readline.c:194: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 (input); data/librep-0.92.7/src/readline.c:235:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). history_file=(char*) malloc((uint) strlen(getenv("HOME")) + (uint) strlen("/.rep_history") +2); data/librep-0.92.7/src/readline.c:235:74: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). history_file=(char*) malloc((uint) strlen(getenv("HOME")) + (uint) strlen("/.rep_history") +2); data/librep-0.92.7/src/realpath.c:182: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). if ((long int) (n + strlen (end)) >= path_max) data/librep-0.92.7/src/regexp.c:174:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) { data/librep-0.92.7/src/regexp.c:176: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). len = strlen(OPERAND(scan)); data/librep-0.92.7/src/regexp.c:897: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). len = strlen(opnd); data/librep-0.92.7/src/regexp.c:906: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). len = strlen(opnd); data/librep-0.92.7/src/regexp.c:1145: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). scan += strlen(scan); data/librep-0.92.7/src/regexp.c:1289:12: [1] (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 character. (void) strcpy(buf, ":"); data/librep-0.92.7/src/regexp.c:1331: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). sprintf(buf + strlen(buf), "OPEN%d", OP(op) - OPEN); data/librep-0.92.7/src/regexp.c:1343: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). sprintf(buf + strlen(buf), "CLOSE%d", OP(op) - CLOSE); data/librep-0.92.7/src/regsub.c:97:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(dst, matches->string.startp[no], len); data/librep-0.92.7/src/rep-remote.c:47: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/librep-0.92.7/src/rep-remote.c:101:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (0, &c, 1) != 1) data/librep-0.92.7/src/rep-remote.c:119:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (0, lbuf, 8) != 8) data/librep-0.92.7/src/rep-remote.c:128: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). long length = strlen (string); data/librep-0.92.7/src/rep-remote.c:139:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (0, buf, length) != length) data/librep-0.92.7/src/rep-remote.c:291:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). this = read (0, buf, this); data/librep-0.92.7/src/rep-remote.c:363:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(srcf, buf, BUFSIZ); data/librep-0.92.7/src/rep-remote.c:431: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). if (dirname[strlen(dirname)-1] != '/') data/librep-0.92.7/src/rep-remote.c:432:6: [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 (dirname, "/"); data/librep-0.92.7/src/rep-remote.c:487: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). if (write (1, buf, strlen (buf)) != strlen (buf)) data/librep-0.92.7/src/rep-remote.c:487:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write (1, buf, strlen (buf)) != strlen (buf)) data/librep-0.92.7/src/rep_lisp.h:269:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*getc)(repv obj); data/librep-0.92.7/src/rep_subrs.h:526:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*getc)(repv), int (*ungetc)(repv, int), data/librep-0.92.7/src/rep_subrs.h:537:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*getc)(repv), data/librep-0.92.7/src/repdoc.c:62: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). out += strlen(out); data/librep-0.92.7/src/repdoc.c:70: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). key.dsize = strlen(id); data/librep-0.92.7/src/repdoc.c:72: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). value.dsize = strlen(buf); data/librep-0.92.7/src/sdbm.c:83:6: [1] (buffer) strlen: Does not handle 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 = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2; data/librep-0.92.7/src/sdbm.c:83: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). n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2; data/librep-0.92.7/src/sdbm.c:83:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2; data/librep-0.92.7/src/sdbm.c:91: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). pagname = strcpy(dirname + strlen(dirname) + 1, file); data/librep-0.92.7/src/sdbm.c:362:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(db->pagf, db->pagbuf, PBLKSIZ) < 0) data/librep-0.92.7/src/sdbm.c:413:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(db->pagf, db->pagbuf, PBLKSIZ) < 0) data/librep-0.92.7/src/sdbm.c:437:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(db->dirf, db->dirbuf, DBLKSIZ) < 0) data/librep-0.92.7/src/sdbm.c:460:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(db->dirf, db->dirbuf, DBLKSIZ) < 0) data/librep-0.92.7/src/sdbm.c:504:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(db->pagf, db->pagbuf, PBLKSIZ) <= 0) data/librep-0.92.7/src/sockets.c:175:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). actual = read (fd, buf, 1024); data/librep-0.92.7/src/sockets.c:275:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (name.sun_path, rep_STR (local), sizeof (name.sun_path)); data/librep-0.92.7/src/sockets.c:278: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). + strlen (name.sun_path) + 1); data/librep-0.92.7/src/streams.c:107:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (t->getc != 0) data/librep-0.92.7/src/streams.c:108:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = (t->getc)(stream); data/librep-0.92.7/src/streams.c:126:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(rep_FILE(stream)->file.fh); data/librep-0.92.7/src/streams.c:136:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (t->getc != 0) data/librep-0.92.7/src/streams.c:137:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = (t->getc)(stream); data/librep-0.92.7/src/streams.c:334:59: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufLen = isValString ? rep_STRING_LEN (rep_VAL (data)) : strlen (buf); data/librep-0.92.7/src/streams.c:684:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). readlen = strlen (offbuf); data/librep-0.92.7/src/streams.c:1029: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). len = strlen (ptr); data/librep-0.92.7/src/streams.c:1221:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (t->getc && t->ungetc) data/librep-0.92.7/src/streams.c:1232:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (t->getc && t->ungetc) data/librep-0.92.7/src/timers.c:212:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read (pipe_fds[0], &dummy, sizeof (dummy)); data/librep-0.92.7/src/unix_dl.c:155: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). char *tem = alloca (strlen(sym) + 2); data/librep-0.92.7/src/unix_dl.c:239:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (tem); data/librep-0.92.7/src/unix_dl.c:273:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name = alloca (strlen (ptr) + 1); data/librep-0.92.7/src/unix_dl.c:279:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name = alloca (strlen(ptr) + data/librep-0.92.7/src/unix_files.c:39: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/librep-0.92.7/src/unix_files.c:183: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). end = iptr + strlen(iptr); data/librep-0.92.7/src/unix_files.c:217:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, rep_STR (file), sizeof (buf)); data/librep-0.92.7/src/unix_files.c:220:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(buf); data/librep-0.92.7/src/unix_files.c:345:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(srcf, buf, BUFSIZ); data/librep-0.92.7/src/unix_files.c:604: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(buf); data/librep-0.92.7/src/unix_main.c:196: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(src); data/librep-0.92.7/src/unix_main.c:233:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, uts.nodename, 256); data/librep-0.92.7/src/unix_processes.c:340:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((actual = read(fd, buf, 1024)) > 0) data/librep-0.92.7/src/unix_processes.c:875:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). actual = read(pr->pr_Stdout, buf, 1024); data/librep-0.92.7/src/unix_processes.c:896:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). actual = read(pr->pr_Stderr, buf, 1024); data/librep-0.92.7/src/values.c:91:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*getc)(repv), data/librep-0.92.7/src/values.c:112:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). t->getc = getc; data/librep-0.92.7/src/values.c:130:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*getc)(repv), data/librep-0.92.7/src/values.c:142:5: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getc, ungetc, putc, puts, bind, unbind); data/librep-0.92.7/src/values.c:295:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return rep_string_dupn(src, strlen(src)); data/librep-0.92.7/src/values.c:301: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(s1) + strlen(s2); data/librep-0.92.7/src/values.c:301: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). int len = strlen(s1) + strlen(s2); data/librep-0.92.7/src/values.c:310: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(s1) + strlen(s2) + strlen(s3); data/librep-0.92.7/src/values.c:310: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). int len = strlen(s1) + strlen(s2) + strlen(s3); data/librep-0.92.7/src/values.c:310: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). int len = strlen(s1) + strlen(s2) + strlen(s3); data/librep-0.92.7/src/values.c:319: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(s1) + strlen(s2) + strlen(s3) + strlen(s4); data/librep-0.92.7/src/values.c:319: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). int len = strlen(s1) + strlen(s2) + strlen(s3) + strlen(s4); data/librep-0.92.7/src/values.c:319: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). int len = strlen(s1) + strlen(s2) + strlen(s3) + strlen(s4); data/librep-0.92.7/src/values.c:319:54: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s1) + strlen(s2) + strlen(s3) + strlen(s4); ANALYSIS SUMMARY: Hits = 401 Lines analyzed = 43275 in approximately 1.02 seconds (42241 lines/second) Physical Source Lines of Code (SLOC) = 31304 Hits@level = [0] 55 [1] 124 [2] 180 [3] 39 [4] 51 [5] 7 Hits@level+ = [0+] 456 [1+] 401 [2+] 277 [3+] 97 [4+] 58 [5+] 7 Hits/KSLOC@level+ = [0+] 14.5668 [1+] 12.8099 [2+] 8.84871 [3+] 3.09865 [4+] 1.8528 [5+] 0.223614 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.