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/mlocate-0.26/admin/link-warning.h Examining data/mlocate-0.26/src/conf.c Examining data/mlocate-0.26/src/lib.c Examining data/mlocate-0.26/src/locate.c Examining data/mlocate-0.26/src/lib.h Examining data/mlocate-0.26/src/conf.h Examining data/mlocate-0.26/src/bind-mount.c Examining data/mlocate-0.26/src/bind-mount.h Examining data/mlocate-0.26/src/updatedb.c Examining data/mlocate-0.26/src/db.h Examining data/mlocate-0.26/tests/bind-mount-helper.c Examining data/mlocate-0.26/gnulib/lib/mbchar.c Examining data/mlocate-0.26/gnulib/lib/strnlen.c Examining data/mlocate-0.26/gnulib/lib/strnlen1.c Examining data/mlocate-0.26/gnulib/lib/xalloc-die.c Examining data/mlocate-0.26/gnulib/lib/wcwidth.c Examining data/mlocate-0.26/gnulib/lib/error.h Examining data/mlocate-0.26/gnulib/lib/stdbool.in.h Examining data/mlocate-0.26/gnulib/lib/exitfail.c Examining data/mlocate-0.26/gnulib/lib/malloca.c Examining data/mlocate-0.26/gnulib/lib/streq.h Examining data/mlocate-0.26/gnulib/lib/time.in.h Examining data/mlocate-0.26/gnulib/lib/malloca.h Examining data/mlocate-0.26/gnulib/lib/canonicalize.h Examining data/mlocate-0.26/gnulib/lib/strerror.c Examining data/mlocate-0.26/gnulib/lib/obstack.h Examining data/mlocate-0.26/gnulib/lib/gettext.h Examining data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c Examining data/mlocate-0.26/gnulib/lib/safe-read.h Examining data/mlocate-0.26/gnulib/lib/progname.h Examining data/mlocate-0.26/gnulib/lib/obstack.c Examining data/mlocate-0.26/gnulib/lib/fnmatch.in.h Examining data/mlocate-0.26/gnulib/lib/mbsstr.c Examining data/mlocate-0.26/gnulib/lib/error.c Examining data/mlocate-0.26/gnulib/lib/uniwidth.h Examining data/mlocate-0.26/gnulib/lib/wctype.in.h Examining data/mlocate-0.26/gnulib/lib/stat-time.h Examining data/mlocate-0.26/gnulib/lib/stdlib.in.h Examining data/mlocate-0.26/gnulib/lib/alloca.in.h Examining data/mlocate-0.26/gnulib/lib/alloca.c Examining data/mlocate-0.26/gnulib/lib/timespec.h Examining data/mlocate-0.26/gnulib/lib/string.in.h Examining data/mlocate-0.26/gnulib/lib/uniwidth/width.c Examining data/mlocate-0.26/gnulib/lib/uniwidth/cjk.h Examining data/mlocate-0.26/gnulib/lib/memchr.c Examining data/mlocate-0.26/gnulib/lib/stdint.in.h Examining data/mlocate-0.26/gnulib/lib/getopt.in.h Examining data/mlocate-0.26/gnulib/lib/mbchar.h Examining data/mlocate-0.26/gnulib/lib/progname.c Examining data/mlocate-0.26/gnulib/lib/localcharset.h Examining data/mlocate-0.26/gnulib/lib/strchrnul.c Examining data/mlocate-0.26/gnulib/lib/wchar.in.h Examining data/mlocate-0.26/gnulib/lib/pathmax.h Examining data/mlocate-0.26/gnulib/lib/mbslen.c Examining data/mlocate-0.26/gnulib/lib/mempcpy.c Examining data/mlocate-0.26/gnulib/lib/unistd.in.h Examining data/mlocate-0.26/gnulib/lib/readlink.c Examining data/mlocate-0.26/gnulib/lib/getopt_int.h Examining data/mlocate-0.26/gnulib/lib/strnlen1.h Examining data/mlocate-0.26/gnulib/lib/safe-read.c Examining data/mlocate-0.26/gnulib/lib/mbuiter.h Examining data/mlocate-0.26/gnulib/lib/fwriteerror.h Examining data/mlocate-0.26/gnulib/lib/exitfail.h Examining data/mlocate-0.26/gnulib/lib/getopt.c Examining data/mlocate-0.26/gnulib/lib/verify.h Examining data/mlocate-0.26/gnulib/lib/getopt1.c Examining data/mlocate-0.26/gnulib/lib/fnmatch.c Examining data/mlocate-0.26/gnulib/lib/localcharset.c Examining data/mlocate-0.26/gnulib/lib/xmalloc.c Examining data/mlocate-0.26/gnulib/lib/xalloc.h Examining data/mlocate-0.26/gnulib/lib/unitypes.h Examining data/mlocate-0.26/gnulib/lib/fnmatch_loop.c Examining data/mlocate-0.26/gnulib/lib/fwriteerror.c FINAL RESULTS: data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:80:21: [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. # define __readlink readlink data/mlocate-0.26/gnulib/lib/readlink.c:38:1: [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. readlink (const char *path, char *buf, size_t bufsize) data/mlocate-0.26/gnulib/lib/unistd.in.h:57:12: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. # define chown rpl_chown data/mlocate-0.26/gnulib/lib/unistd.in.h:58:12: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. extern int chown (const char *file, uid_t uid, gid_t gid); data/mlocate-0.26/gnulib/lib/unistd.in.h:62:9: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. # undef chown data/mlocate-0.26/gnulib/lib/unistd.in.h:63:10: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. # define chown(f,u,g) \ data/mlocate-0.26/gnulib/lib/unistd.in.h:67:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown (f, u, g)) data/mlocate-0.26/gnulib/lib/unistd.in.h:228: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. extern int readlink (const char *file, char *buf, size_t bufsize); data/mlocate-0.26/gnulib/lib/unistd.in.h:231:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. # undef readlink data/mlocate-0.26/gnulib/lib/unistd.in.h:232:10: [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. # define readlink(f,b,s) \ data/mlocate-0.26/gnulib/lib/unistd.in.h:235:6: [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. readlink (f, b, s)) data/mlocate-0.26/src/updatedb.c:950:11: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown (new_db_filename, (uid_t)-1, grp->gr_gid) != 0) data/mlocate-0.26/src/updatedb.c:965:7: [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 (new_db_filename, mode) != 0) data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:322:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (resolved, rpath); data/mlocate-0.26/gnulib/lib/error.c:206: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, message, args); data/mlocate-0.26/gnulib/lib/error.c:318:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf (stderr, file_name != NULL ? "%s:%d: " : " ", data/mlocate-0.26/gnulib/lib/error.h:31:22: [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 __printf__ printf data/mlocate-0.26/gnulib/lib/fnmatch.c:161:23: [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). # define STRCAT(D, S) strcat (D, S) data/mlocate-0.26/gnulib/lib/fnmatch.c:192:25: [4] (buffer) wcscat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). # define STRCAT(D, S) wcscat (D, S) data/mlocate-0.26/gnulib/lib/localcharset.c:196: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 (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); data/mlocate-0.26/gnulib/lib/localcharset.c:197: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 (res_ptr + res_size - (l2 + 1), buf2); data/mlocate-0.26/gnulib/lib/strerror.c:38:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (mesg, fmt, n); data/mlocate-0.26/gnulib/lib/strerror.c:54:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. int sprintf (char *, char const *, ...); data/mlocate-0.26/gnulib/lib/strerror.c:66:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (mesg, fmt, n); data/mlocate-0.26/src/locate.c:258:18: [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. new->allowed = access (path, R_OK | X_OK) == 0; data/mlocate-0.26/src/locate.c:308:39: [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 (cached_access_rx (copy) != 0 && access (copy, R_OK) != 0) data/mlocate-0.26/src/locate.c:341:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (ngettext ("\t%'ju directory\n", "\t%'ju directories\n", data/mlocate-0.26/src/locate.c:343:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (ngettext ("\t%'ju file\n", "\t%'ju files\n", stats_entries), data/mlocate-0.26/src/locate.c:345:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (ngettext ("\t%'ju byte in file names\n", data/mlocate-0.26/src/locate.c:347:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (ngettext ("\t%'ju byte used to store database\n", data/mlocate-0.26/src/locate.c:1032:35: [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 (conf_statistics == false && access ("/", R_OK | X_OK) != 0) data/mlocate-0.26/src/updatedb.c:912:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (filename, "%s.XXXXXX", conf_output); data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:23: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. #undef realpath data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:78:30: [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/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:330:37: [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. versioned_symbol (libc, __realpath, realpath, GLIBC_2_3); data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:346:38: [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. compat_symbol (libc, __old_realpath, realpath, GLIBC_2_0); data/mlocate-0.26/gnulib/lib/fnmatch_loop.c:209:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; data/mlocate-0.26/gnulib/lib/fnmatch_loop.c:989:22: [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. posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; data/mlocate-0.26/gnulib/lib/fnmatch_loop.c:1042:22: [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. posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; data/mlocate-0.26/gnulib/lib/getopt.c:109: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. extern char *getenv (); data/mlocate-0.26/gnulib/lib/getopt.c:244:47: [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. d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); data/mlocate-0.26/gnulib/lib/getopt.c:1116:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (int argc, char *const *argv, const char *optstring) data/mlocate-0.26/gnulib/lib/getopt.c:1138:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt (argc, argv, "abc:d:0123456789"); data/mlocate-0.26/gnulib/lib/getopt.in.h:39:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # undef getopt data/mlocate-0.26/gnulib/lib/getopt.in.h:40:9: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # undef getopt_long data/mlocate-0.26/gnulib/lib/getopt.in.h:49:10: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt __GETOPT_ID (getopt) data/mlocate-0.26/gnulib/lib/getopt.in.h:49:30: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt __GETOPT_ID (getopt) data/mlocate-0.26/gnulib/lib/getopt.in.h:50:10: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt_long __GETOPT_ID (getopt_long) data/mlocate-0.26/gnulib/lib/getopt.in.h:50:35: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt_long __GETOPT_ID (getopt_long) data/mlocate-0.26/gnulib/lib/getopt.in.h:204:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) data/mlocate-0.26/gnulib/lib/getopt.in.h:208:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, data/mlocate-0.26/gnulib/lib/getopt1.c:41:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, data/mlocate-0.26/gnulib/lib/getopt1.c:106:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "abc:d:0123456789", data/mlocate-0.26/gnulib/lib/localcharset.c:121: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. dir = getenv ("CHARSETALIASDIR"); data/mlocate-0.26/gnulib/lib/localcharset.c:308:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. locale = getenv ("LC_ALL"); data/mlocate-0.26/gnulib/lib/localcharset.c:311: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. locale = getenv ("LC_CTYPE"); data/mlocate-0.26/gnulib/lib/localcharset.c:313:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. locale = getenv ("LANG"); data/mlocate-0.26/gnulib/lib/localcharset.c:359:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. locale = getenv ("LC_ALL"); data/mlocate-0.26/gnulib/lib/localcharset.c:362: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. locale = getenv ("LC_CTYPE"); data/mlocate-0.26/gnulib/lib/localcharset.c:364:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. locale = getenv ("LANG"); data/mlocate-0.26/gnulib/lib/localcharset.c:392: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. locale = getenv ("LC_ALL"); data/mlocate-0.26/gnulib/lib/localcharset.c:395:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. locale = getenv ("LC_CTYPE"); data/mlocate-0.26/gnulib/lib/localcharset.c:397: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. locale = getenv ("LANG"); data/mlocate-0.26/src/conf.c:528:13: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. opt = getopt_long (argc, argv, "U:Ve:f:hl:n:o:v", options, &idx); data/mlocate-0.26/src/locate.c:694:13: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. opt = getopt_long (argc, argv, "0AHPLSVbcd:ehil:mn:qr:sw", options, &idx); data/mlocate-0.26/src/locate.c:910:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. locate_path = getenv ("LOCATE_PATH"); data/mlocate-0.26/admin/link-warning.h:18:22: [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 warning[sizeof (message)] \ data/mlocate-0.26/gnulib/lib/alloca.c:133: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 align[ALIGN_SIZE]; /* To force sizeof(header). */ data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:232: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/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:295:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. name = end = memcpy (extra_buf, buf, n); data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:314:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath; data/mlocate-0.26/gnulib/lib/error.c:111: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 errbuf[1024]; data/mlocate-0.26/gnulib/lib/fnmatch.c:168:49: [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 MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) data/mlocate-0.26/gnulib/lib/fnmatch.c:213: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 s[CHAR_CLASS_MAX_LENGTH + 1]; data/mlocate-0.26/gnulib/lib/fnmatch_loop.c:462:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[c1]; data/mlocate-0.26/gnulib/lib/fnmatch_loop.c:683: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 str[c1]; data/mlocate-0.26/gnulib/lib/fwriteerror.c:126: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 dummy[8193]; data/mlocate-0.26/gnulib/lib/fwriteerror.c:137: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 *stream = fopen (UNWRITABLE_FILE, "w"); data/mlocate-0.26/gnulib/lib/gettext.h:200:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg_ctxt_id[msgctxt_len + msgid_len]; data/mlocate-0.26/gnulib/lib/gettext.h:202: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[1024]; data/mlocate-0.26/gnulib/lib/gettext.h:210: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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/mlocate-0.26/gnulib/lib/gettext.h:212: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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/mlocate-0.26/gnulib/lib/gettext.h:246:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg_ctxt_id[msgctxt_len + msgid_len]; data/mlocate-0.26/gnulib/lib/gettext.h:248: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[1024]; data/mlocate-0.26/gnulib/lib/gettext.h:256: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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/mlocate-0.26/gnulib/lib/gettext.h:258: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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/mlocate-0.26/gnulib/lib/localcharset.c:133: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 (file_name, dir, dir_len); data/mlocate-0.26/gnulib/lib/localcharset.c:136: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 (file_name + dir_len + add_slash, base, base_len + 1); data/mlocate-0.26/gnulib/lib/localcharset.c:140:38: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) data/mlocate-0.26/gnulib/lib/localcharset.c:152:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf1[50+1]; data/mlocate-0.26/gnulib/lib/localcharset.c:153:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf2[50+1]; data/mlocate-0.26/gnulib/lib/localcharset.c:306: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 char buf[2 + 10 + 1]; data/mlocate-0.26/gnulib/lib/localcharset.c:332: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, dot, modifier - dot); data/mlocate-0.26/gnulib/lib/localcharset.c:340:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (buf, "CP%u", GetACP ()); data/mlocate-0.26/gnulib/lib/localcharset.c:377:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[2 + 10 + 1]; data/mlocate-0.26/gnulib/lib/localcharset.c:380:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (buf, "CP%u", GetACP ()); data/mlocate-0.26/gnulib/lib/localcharset.c:386:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[2 + 10 + 1]; data/mlocate-0.26/gnulib/lib/localcharset.c:415: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 (buf, dot, modifier - dot); data/mlocate-0.26/gnulib/lib/localcharset.c:431:4: [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, "CP%u", cp[0]); data/mlocate-0.26/gnulib/lib/malloca.c:48:41: [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. struct preliminary_header { void *next; char room[MAGIC_SIZE]; }; data/mlocate-0.26/gnulib/lib/malloca.c:52:29: [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. struct header { void *next; char room[HEADER_SIZE - sizeof (struct preliminary_header) + MAGIC_SIZE]; }; data/mlocate-0.26/gnulib/lib/mbchar.h:168: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[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */ data/mlocate-0.26/gnulib/lib/mbchar.h:265: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_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes); data/mlocate-0.26/gnulib/lib/mbsstr.c:314: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 (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t)); data/mlocate-0.26/gnulib/lib/mbuiter.h:195:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t)); data/mlocate-0.26/gnulib/lib/mempcpy.c:28:19: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return (char *) memcpy (dest, src, n) + n; data/mlocate-0.26/gnulib/lib/obstack.h:147:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char contents[4]; /* objects begin here */ data/mlocate-0.26/gnulib/lib/obstack.h:302: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 (__o->next_free, where, __len); \ data/mlocate-0.26/gnulib/lib/obstack.h:312: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 (__o->next_free, where, __len); \ data/mlocate-0.26/gnulib/lib/obstack.h:438: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 ((h)->next_free, where, (h)->temp.tempint), \ data/mlocate-0.26/gnulib/lib/obstack.h:445: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 ((h)->next_free, where, (h)->temp.tempint), \ data/mlocate-0.26/gnulib/lib/stdlib.in.h:156:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). # define mkstemp rpl_mkstemp data/mlocate-0.26/gnulib/lib/stdlib.in.h:157:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). extern int mkstemp (char * /*template*/); data/mlocate-0.26/gnulib/lib/stdlib.in.h:163:9: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). # undef mkstemp data/mlocate-0.26/gnulib/lib/stdlib.in.h:164:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). # define mkstemp(t) \ data/mlocate-0.26/gnulib/lib/stdlib.in.h:167:6: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). mkstemp (t)) data/mlocate-0.26/gnulib/lib/strerror.c:32: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 mesg[sizeof fmt + sizeof n * CHAR_BIT / 3]; data/mlocate-0.26/gnulib/lib/strerror.c:62: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 mesg[sizeof fmt + sizeof n * CHAR_BIT / 3]; data/mlocate-0.26/gnulib/lib/uniwidth/width.c:37: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 nonspacing_table_data[22*64] = { data/mlocate-0.26/gnulib/lib/uniwidth/width.c:237:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const signed char nonspacing_table_ind[240] = { data/mlocate-0.26/gnulib/lib/xmalloc.c:114: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. return memcpy (xmalloc (s), p, s); data/mlocate-0.26/src/bind-mount.c:93: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[LINE_MAX]; data/mlocate-0.26/src/bind-mount.c:236: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). f = fopen (mountinfo_path, "r"); data/mlocate-0.26/src/bind-mount.c:406: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). mountinfo_fd = open (mountinfo_path, O_RDONLY); data/mlocate-0.26/src/conf.c:305: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). uc_file = fopen (UPDATEDB_CONF, "r"); data/mlocate-0.26/src/conf.c:487:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buf + len1 + 1, path, size2); data/mlocate-0.26/src/lib.c:49: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 (&ret, &high, sizeof (high)); data/mlocate-0.26/src/lib.c:50: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 ((unsigned char *)&ret + sizeof (high), &low, sizeof (low)); data/mlocate-0.26/src/lib.c:67: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. static unsigned char dir_path_cmp_table[UCHAR_MAX + 1]; data/mlocate-0.26/src/lib.h:103:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[BUFSIZ]; data/mlocate-0.26/src/locate.c:259: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 (new->path, path, len); data/mlocate-0.26/src/locate.c:284: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, path, size); data/mlocate-0.26/src/locate.c:981:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (entry, O_RDONLY); data/mlocate-0.26/src/updatedb.c:288: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 (conf_output, O_RDWR); data/mlocate-0.26/src/updatedb.c:313: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[BUFSIZ]; data/mlocate-0.26/src/updatedb.c:382: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 (type, me->mnt_type, size); data/mlocate-0.26/src/updatedb.c:477: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 (path, dir->path, prefix_len); data/mlocate-0.26/src/updatedb.c:495: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 (path + prefix_len, e->name, e->name_size); data/mlocate-0.26/src/updatedb.c:518:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (".", O_RDONLY); data/mlocate-0.26/src/updatedb.c:639:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (path, O_RDONLY | O_DIRECTORY | O_NOATIME); data/mlocate-0.26/src/updatedb.c:692: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 (e->name, de->d_name, name_size); data/mlocate-0.26/src/updatedb.c:913:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). db_fd = mkstemp (filename); data/mlocate-0.26/src/updatedb.c:926: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 (db_header.magic, &magic, sizeof (magic)); data/mlocate-0.26/gnulib/lib/canonicalize-lgpl.c:285: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). len = strlen (end); data/mlocate-0.26/gnulib/lib/error.c:143: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 (message) + 1; data/mlocate-0.26/gnulib/lib/fnmatch.c:160: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). # define STRLEN(S) strlen (S) data/mlocate-0.26/gnulib/lib/fnmatch.c:191:22: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). # define STRLEN(S) wcslen (S) data/mlocate-0.26/gnulib/lib/fnmatch.c:340: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). return internal_fnmatch (pattern, string, string + strlen (string), data/mlocate-0.26/gnulib/lib/getopt.c:275:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = d->__nonoption_flags_max_len = strlen (orig_str); data/mlocate-0.26/gnulib/lib/getopt.c:502: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). == (unsigned int) strlen (p->name)) data/mlocate-0.26/gnulib/lib/getopt.c:551: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). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:624:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:664:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:669: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). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:872:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) data/mlocate-0.26/gnulib/lib/getopt.c:917:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:961: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). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:999: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). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/getopt.c:1003:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). d->__nextchar += strlen (d->__nextchar); data/mlocate-0.26/gnulib/lib/gettext.h:196: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). size_t msgctxt_len = strlen (msgctxt) + 1; data/mlocate-0.26/gnulib/lib/gettext.h:197:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/mlocate-0.26/gnulib/lib/gettext.h:242: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). size_t msgctxt_len = strlen (msgctxt) + 1; data/mlocate-0.26/gnulib/lib/gettext.h:243:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/mlocate-0.26/gnulib/lib/localcharset.c:86:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # undef getc data/mlocate-0.26/gnulib/lib/localcharset.c:87:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define getc getc_unlocked data/mlocate-0.26/gnulib/lib/localcharset.c:127: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). size_t dir_len = strlen (dir); data/mlocate-0.26/gnulib/lib/localcharset.c:128:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t base_len = strlen (base); data/mlocate-0.26/gnulib/lib/localcharset.c:157:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (fp); data/mlocate-0.26/gnulib/lib/localcharset.c:166:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (fp); data/mlocate-0.26/gnulib/lib/localcharset.c:173:12: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) data/mlocate-0.26/gnulib/lib/localcharset.c:175: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). l1 = strlen (buf1); data/mlocate-0.26/gnulib/lib/localcharset.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). l2 = strlen (buf2); data/mlocate-0.26/gnulib/lib/localcharset.c:445: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). aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) data/mlocate-0.26/gnulib/lib/localcharset.c:445:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) data/mlocate-0.26/gnulib/lib/localcharset.c:449:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). codeset = aliases + strlen (aliases) + 1; data/mlocate-0.26/gnulib/lib/mbslen.c:48: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). return strlen (string); data/mlocate-0.26/gnulib/lib/mbsstr.c:40:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t m = strlen (needle); data/mlocate-0.26/gnulib/lib/mbuiter.h:160:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). iter->cur.bytes = strlen (iter->cur.ptr); data/mlocate-0.26/gnulib/lib/safe-read.c:48:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define rw read data/mlocate-0.26/gnulib/lib/xmalloc.c:122: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). return xmemdup (string, strlen (string) + 1); data/mlocate-0.26/src/bind-mount.c:102:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). chunk_length = strlen (buf); data/mlocate-0.26/src/bind-mount.c:347: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). p_mount_len = strlen (parent->mount_point); data/mlocate-0.26/src/bind-mount.c:348:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). p_root_len = strlen (parent->root); data/mlocate-0.26/src/bind-mount.c:363: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 (me->mount_point) + 1); data/mlocate-0.26/src/conf.c:483: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). len1 = strlen (buf); data/mlocate-0.26/src/conf.c:484: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). size2 = strlen (path) + 1; data/mlocate-0.26/src/conf.c:672:5: [1] (buffer) strlen: Does not handle 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 (strings->entries[i]) + 1); data/mlocate-0.26/src/locate.c:121: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). left = strlen (src) + 1; data/mlocate-0.26/src/locate.c:174: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). left = strlen (string); data/mlocate-0.26/src/locate.c:242:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (path); data/mlocate-0.26/src/locate.c:280:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = strlen (path) + 1; data/mlocate-0.26/src/locate.c:426:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). stats_bytes += strlen (path); data/mlocate-0.26/src/updatedb.c:379:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = strlen (me->mnt_type) + 1; data/mlocate-0.26/src/updatedb.c:450: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). fwrite (dir->path, 1, strlen (dir->path) + 1, new_db); data/mlocate-0.26/src/updatedb.c:474: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). prefix_len = strlen (dir->path); data/mlocate-0.26/src/updatedb.c:673: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_size = strlen (de->d_name) + 1; data/mlocate-0.26/src/updatedb.c:911:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). filename = xmalloc (strlen (conf_output) + 8); data/mlocate-0.26/src/updatedb.c:933: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). fwrite (conf_scan_root, 1, strlen (conf_scan_root) + 1, new_db); data/mlocate-0.26/src/updatedb.c:960:14: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask (S_IRWXU | S_IRWXG | S_IRWXG); data/mlocate-0.26/src/updatedb.c:961:7: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (mask); ANALYSIS SUMMARY: Hits = 200 Lines analyzed = 16346 in approximately 0.51 seconds (32271 lines/second) Physical Source Lines of Code (SLOC) = 10207 Hits@level = [0] 70 [1] 57 [2] 77 [3] 34 [4] 19 [5] 13 Hits@level+ = [0+] 270 [1+] 200 [2+] 143 [3+] 66 [4+] 32 [5+] 13 Hits/KSLOC@level+ = [0+] 26.4524 [1+] 19.5944 [2+] 14.01 [3+] 6.46615 [4+] 3.1351 [5+] 1.27364 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.