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/notmuch-0.31.2/bindings/ruby/database.c Examining data/notmuch-0.31.2/bindings/ruby/defs.h Examining data/notmuch-0.31.2/bindings/ruby/directory.c Examining data/notmuch-0.31.2/bindings/ruby/filenames.c Examining data/notmuch-0.31.2/bindings/ruby/init.c Examining data/notmuch-0.31.2/bindings/ruby/message.c Examining data/notmuch-0.31.2/bindings/ruby/messages.c Examining data/notmuch-0.31.2/bindings/ruby/query.c Examining data/notmuch-0.31.2/bindings/ruby/status.c Examining data/notmuch-0.31.2/bindings/ruby/tags.c Examining data/notmuch-0.31.2/bindings/ruby/thread.c Examining data/notmuch-0.31.2/bindings/ruby/threads.c Examining data/notmuch-0.31.2/command-line-arguments.c Examining data/notmuch-0.31.2/command-line-arguments.h Examining data/notmuch-0.31.2/compat/canonicalize_file_name.c Examining data/notmuch-0.31.2/compat/check_asctime.c Examining data/notmuch-0.31.2/compat/check_getpwuid.c Examining data/notmuch-0.31.2/compat/compat.h Examining data/notmuch-0.31.2/compat/function-attributes.h Examining data/notmuch-0.31.2/compat/gen_zlib_pc.c Examining data/notmuch-0.31.2/compat/getdelim.c Examining data/notmuch-0.31.2/compat/getline.c Examining data/notmuch-0.31.2/compat/have_canonicalize_file_name.c Examining data/notmuch-0.31.2/compat/have_d_type.c Examining data/notmuch-0.31.2/compat/have_getline.c Examining data/notmuch-0.31.2/compat/have_strcasestr.c Examining data/notmuch-0.31.2/compat/have_strsep.c Examining data/notmuch-0.31.2/compat/have_timegm.c Examining data/notmuch-0.31.2/compat/strcasestr.c Examining data/notmuch-0.31.2/compat/strsep.c Examining data/notmuch-0.31.2/compat/timegm.c Examining data/notmuch-0.31.2/debugger.c Examining data/notmuch-0.31.2/gmime-filter-reply.c Examining data/notmuch-0.31.2/gmime-filter-reply.h Examining data/notmuch-0.31.2/hooks.c Examining data/notmuch-0.31.2/lib/add-message.cc Examining data/notmuch-0.31.2/lib/built-with.c Examining data/notmuch-0.31.2/lib/config.cc Examining data/notmuch-0.31.2/lib/database-private.h Examining data/notmuch-0.31.2/lib/database.cc Examining data/notmuch-0.31.2/lib/directory.cc Examining data/notmuch-0.31.2/lib/filenames.c Examining data/notmuch-0.31.2/lib/index.cc Examining data/notmuch-0.31.2/lib/indexopts.c Examining data/notmuch-0.31.2/lib/message-file.c Examining data/notmuch-0.31.2/lib/message-id.c Examining data/notmuch-0.31.2/lib/message-private.h Examining data/notmuch-0.31.2/lib/message-property.cc Examining data/notmuch-0.31.2/lib/message.cc Examining data/notmuch-0.31.2/lib/messages.c Examining data/notmuch-0.31.2/lib/notmuch-private.h Examining data/notmuch-0.31.2/lib/notmuch.h Examining data/notmuch-0.31.2/lib/parse-time-vrp.cc Examining data/notmuch-0.31.2/lib/parse-time-vrp.h Examining data/notmuch-0.31.2/lib/query-fp.cc Examining data/notmuch-0.31.2/lib/query-fp.h Examining data/notmuch-0.31.2/lib/query.cc Examining data/notmuch-0.31.2/lib/regexp-fields.cc Examining data/notmuch-0.31.2/lib/regexp-fields.h Examining data/notmuch-0.31.2/lib/sha1.c Examining data/notmuch-0.31.2/lib/string-list.c Examining data/notmuch-0.31.2/lib/string-map.c Examining data/notmuch-0.31.2/lib/tags.c Examining data/notmuch-0.31.2/lib/thread-fp.cc Examining data/notmuch-0.31.2/lib/thread-fp.h Examining data/notmuch-0.31.2/lib/thread.cc Examining data/notmuch-0.31.2/mime-node.c Examining data/notmuch-0.31.2/notmuch-client.h Examining data/notmuch-0.31.2/notmuch-compact.c Examining data/notmuch-0.31.2/notmuch-config.c Examining data/notmuch-0.31.2/notmuch-count.c Examining data/notmuch-0.31.2/notmuch-dump.c Examining data/notmuch-0.31.2/notmuch-insert.c Examining data/notmuch-0.31.2/notmuch-new.c Examining data/notmuch-0.31.2/notmuch-reindex.c Examining data/notmuch-0.31.2/notmuch-reply.c Examining data/notmuch-0.31.2/notmuch-restore.c Examining data/notmuch-0.31.2/notmuch-search.c Examining data/notmuch-0.31.2/notmuch-setup.c Examining data/notmuch-0.31.2/notmuch-show.c Examining data/notmuch-0.31.2/notmuch-tag.c Examining data/notmuch-0.31.2/notmuch-time.c Examining data/notmuch-0.31.2/notmuch.c Examining data/notmuch-0.31.2/parse-time-string/parse-time-string.c Examining data/notmuch-0.31.2/parse-time-string/parse-time-string.h Examining data/notmuch-0.31.2/query-string.c Examining data/notmuch-0.31.2/sprinter-json.c Examining data/notmuch-0.31.2/sprinter-sexp.c Examining data/notmuch-0.31.2/sprinter-text.c Examining data/notmuch-0.31.2/sprinter.h Examining data/notmuch-0.31.2/status.c Examining data/notmuch-0.31.2/tag-util.c Examining data/notmuch-0.31.2/tag-util.h Examining data/notmuch-0.31.2/test/arg-test.c Examining data/notmuch-0.31.2/test/database-test.c Examining data/notmuch-0.31.2/test/database-test.h Examining data/notmuch-0.31.2/test/ghost-report.cc Examining data/notmuch-0.31.2/test/hex-xcode.c Examining data/notmuch-0.31.2/test/make-db-version.cc Examining data/notmuch-0.31.2/test/message-id-parse.c Examining data/notmuch-0.31.2/test/notmuch-test.h Examining data/notmuch-0.31.2/test/parse-time.c Examining data/notmuch-0.31.2/test/random-corpus.c Examining data/notmuch-0.31.2/test/smtp-dummy.c Examining data/notmuch-0.31.2/test/symbol-test.cc Examining data/notmuch-0.31.2/util/crypto.c Examining data/notmuch-0.31.2/util/crypto.h Examining data/notmuch-0.31.2/util/error_util.c Examining data/notmuch-0.31.2/util/error_util.h Examining data/notmuch-0.31.2/util/gmime-extra.c Examining data/notmuch-0.31.2/util/gmime-extra.h Examining data/notmuch-0.31.2/util/hex-escape.c Examining data/notmuch-0.31.2/util/hex-escape.h Examining data/notmuch-0.31.2/util/repair.c Examining data/notmuch-0.31.2/util/repair.h Examining data/notmuch-0.31.2/util/string-util.c Examining data/notmuch-0.31.2/util/string-util.h Examining data/notmuch-0.31.2/util/talloc-extra.c Examining data/notmuch-0.31.2/util/talloc-extra.h Examining data/notmuch-0.31.2/util/unicode-util.c Examining data/notmuch-0.31.2/util/unicode-util.h Examining data/notmuch-0.31.2/util/util.c Examining data/notmuch-0.31.2/util/util.h Examining data/notmuch-0.31.2/util/xutil.c Examining data/notmuch-0.31.2/util/xutil.h Examining data/notmuch-0.31.2/util/zlib-extra.c Examining data/notmuch-0.31.2/util/zlib-extra.h FINAL RESULTS: data/notmuch-0.31.2/debugger.c:41: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. if (readlink (buf, buf2, sizeof (buf2)) != -1 && data/notmuch-0.31.2/compat/gen_zlib_pc.c:17:5: [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 (template, ZLIB_VERSION); data/notmuch-0.31.2/hooks.c:41:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access (hook_path, X_OK) == -1) { data/notmuch-0.31.2/hooks.c:63:2: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl (hook_path, hook_path, NULL); data/notmuch-0.31.2/lib/add-message.cc:49:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (thread_id, "%016" PRIx64, notmuch->last_thread_id); data/notmuch-0.31.2/lib/message.cc:870: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 (p, RECURSIVE_SUFFIX); data/notmuch-0.31.2/lib/thread.cc:28:35: [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 THREAD_DEBUG(format, ...) fprintf (stderr, format " (%s).\n", ##__VA_ARGS__, __location__) data/notmuch-0.31.2/lib/thread.cc:227: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 (clean_author, author); data/notmuch-0.31.2/notmuch-client.h:92:2: [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, \ data/notmuch-0.31.2/notmuch-setup.c:140:2: [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 (format, ##__VA_ARGS__); \ data/notmuch-0.31.2/notmuch.c:289:9: [4] (shell) execlp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (execlp ("man", "man", page, (char *) NULL)) { data/notmuch-0.31.2/notmuch.c:434:5: [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/notmuch-0.31.2/sprinter-json.c:132:5: [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 (spj->stream, "%"PRId64, val); data/notmuch-0.31.2/sprinter-sexp.c:169:5: [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 (sps->stream, "%"PRId64, val); data/notmuch-0.31.2/sprinter-text.c:52:5: [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 (sptxt->stream, "%"PRId64, val); data/notmuch-0.31.2/tag-util.c:28:5: [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, status < 0 ? "Error: " : "Warning: "); data/notmuch-0.31.2/tag-util.c:29: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, format, va_args); data/notmuch-0.31.2/tag-util.c:203: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, format, va_args); data/notmuch-0.31.2/test/parse-time.c:77:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (p, argv[i]); data/notmuch-0.31.2/util/error_util.c:35: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, format, va_args); data/notmuch-0.31.2/util/string-util.c:119: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 (out, prefix); data/notmuch-0.31.2/util/string-util.c:125: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 (out, term); data/notmuch-0.31.2/compat/canonicalize_file_name.c:14:12: [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. return realpath (path, resolved_path); data/notmuch-0.31.2/lib/database.cc:1749: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. const char *thresh = getenv ("XAPIAN_FLUSH_THRESHOLD"); data/notmuch-0.31.2/lib/query.cc:73:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *env = getenv ("NOTMUCH_DEBUG_QUERY"); data/notmuch-0.31.2/notmuch-config.c:353:38: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. } else if ((notmuch_config_env = getenv ("NOTMUCH_CONFIG"))) { data/notmuch-0.31.2/notmuch-config.c:357: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. getenv ("HOME")); data/notmuch-0.31.2/notmuch-config.c:390: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. char *path = getenv ("MAILDIR"); data/notmuch-0.31.2/notmuch-config.c:395: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. getenv ("HOME")); data/notmuch-0.31.2/notmuch-config.c:401: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. char *name = getenv ("NAME"); data/notmuch-0.31.2/notmuch-config.c:411:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *email = getenv ("EMAIL"); data/notmuch-0.31.2/notmuch-config.c:658:53: [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 *abs_path = talloc_asprintf (config, "%s/%s", getenv ("HOME"), db_path); data/notmuch-0.31.2/notmuch.c:511:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. talloc_report = getenv ("NOTMUCH_TALLOC_REPORT"); data/notmuch-0.31.2/test/parse-time.c:254:6: [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, "huUdf:r:", options, NULL); data/notmuch-0.31.2/test/random-corpus.c:71:17: [3] (random) random: 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. int class = random () % GLYPH_MAX; data/notmuch-0.31.2/test/random-corpus.c:78:35: [3] (random) random: 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. return char_class[i].start + (random () % size); data/notmuch-0.31.2/test/random-corpus.c:190:5: [3] (random) srandom: 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. srandom (seed); data/notmuch-0.31.2/test/random-corpus.c:196:17: [3] (random) random: 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. int num_tags = random () % (max_tags + 1); data/notmuch-0.31.2/test/random-corpus.c:198:22: [3] (random) random: 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. int this_mid_len = (random () % message_id_len) + 1; data/notmuch-0.31.2/test/random-corpus.c:209:22: [3] (random) random: 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. int this_tag_len = random () % tag_len + 1; data/notmuch-0.31.2/debugger.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 buf[1024]; data/notmuch-0.31.2/debugger.c:35: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 buf2[1024]; data/notmuch-0.31.2/debugger.c:40: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, "/proc/%d/exe", getppid ()); data/notmuch-0.31.2/lib/add-message.cc:45: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 thread_id[17]; data/notmuch-0.31.2/lib/database-private.h:197: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). bool open; data/notmuch-0.31.2/lib/database.cc:1113: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 (notmuch->open) { data/notmuch-0.31.2/lib/database.cc:1750:16: [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 (thresh && atoi (thresh) == 1) data/notmuch-0.31.2/lib/message-file.c:125: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 from_buf[5]; data/notmuch-0.31.2/lib/message.cc:1909: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 flag_map[128]; data/notmuch-0.31.2/lib/message.cc:1979:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat (filename_new, ":2,"); data/notmuch-0.31.2/lib/message.cc:1993: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 (dir, "cur/", 4); data/notmuch-0.31.2/lib/sha1.c:60:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char block[BLOCK_SIZE]; data/notmuch-0.31.2/lib/sha1.c:65:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen (filename, "r"); data/notmuch-0.31.2/mime-node.c:106:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (filename, O_RDONLY); data/notmuch-0.31.2/mime-node.c:117:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (filename, O_RDONLY); data/notmuch-0.31.2/notmuch-config.c:219:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen (config->filename, "r"); data/notmuch-0.31.2/notmuch-config.c:415: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 hostname[256]; data/notmuch-0.31.2/notmuch-count.c:188: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). input = fopen (input_file_name, "r"); data/notmuch-0.31.2/notmuch-dump.c:295: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). outfd = mkstemp (tempname); data/notmuch-0.31.2/notmuch-insert.c:73:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (dir, O_RDONLY); data/notmuch-0.31.2/notmuch-insert.c:191: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 hostname[256]; data/notmuch-0.31.2/notmuch-insert.c:231:7: [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_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode); data/notmuch-0.31.2/notmuch-insert.c:255: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[4096]; data/notmuch-0.31.2/notmuch-insert.c:343: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 (newpath + strlen (maildir) + 1, "new", 3); data/notmuch-0.31.2/notmuch-show.c:840: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 date_asctime[26]; data/notmuch-0.31.2/notmuch-show.c:889: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[4096]; data/notmuch-0.31.2/notmuch-tag.c:227: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). input = fopen (input_file_name, "r"); data/notmuch-0.31.2/notmuch.c:517:17: [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 *report = fopen (talloc_report, "w"); data/notmuch-0.31.2/sprinter-json.c:55:49: [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). json_begin_aggregate (struct sprinter *sp, char open, char close) data/notmuch-0.31.2/sprinter-json.c:60: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). fputc (open, spj->stream); data/notmuch-0.31.2/test/parse-time.c:162: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 result[1024]; data/notmuch-0.31.2/test/parse-time.c:239: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[1024]; data/notmuch-0.31.2/test/smtp-dummy.c:161:14: [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). output = fopen (output_filename, "w"); data/notmuch-0.31.2/util/gmime-extra.c:8: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[4]; data/notmuch-0.31.2/util/hex-escape.c:85: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 (q, "%%%02x", (unsigned char) *p++); data/notmuch-0.31.2/util/hex-escape.c:101: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[3]; data/notmuch-0.31.2/util/xutil.c:96: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 (ret, s, n); data/notmuch-0.31.2/command-line-arguments.c:197: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). if (strlen (arg) > strlen (NEGATIVE_PREFIX) && data/notmuch-0.31.2/command-line-arguments.c:197: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 (strlen (arg) > strlen (NEGATIVE_PREFIX) && data/notmuch-0.31.2/command-line-arguments.c:198: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). strncmp (arg, NEGATIVE_PREFIX, strlen (NEGATIVE_PREFIX)) == 0) { data/notmuch-0.31.2/command-line-arguments.c:199: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). negative_arg = arg + strlen (NEGATIVE_PREFIX); data/notmuch-0.31.2/command-line-arguments.c:222:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp (arg, try->name, strlen (try->name)) == 0) { data/notmuch-0.31.2/command-line-arguments.c:223: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). next = arg[strlen (try->name)]; data/notmuch-0.31.2/command-line-arguments.c:224: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 = arg + strlen (try->name) + 1; data/notmuch-0.31.2/command-line-arguments.c:226:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncmp (negative_arg, try->name, strlen (try->name)) == 0) { data/notmuch-0.31.2/command-line-arguments.c:227:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). next = negative_arg[strlen (try->name)]; data/notmuch-0.31.2/command-line-arguments.c:228: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). value = negative_arg + strlen (try->name) + 1; data/notmuch-0.31.2/command-line-arguments.c:300: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). if (strlen (argv[opt_index]) == 2) data/notmuch-0.31.2/compat/getdelim.c:37:41: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define getc_maybe_unlocked(fp) getc (fp) data/notmuch-0.31.2/compat/getdelim.c:43:41: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). # define getc_maybe_unlocked(fp) getc (fp) data/notmuch-0.31.2/compat/strcasestr.c:30: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 hay_len = strlen (haystack); data/notmuch-0.31.2/compat/strcasestr.c:31: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 needle_len = strlen (needle); data/notmuch-0.31.2/lib/add-message.cc:59: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). if (strlen (message_id) > NOTMUCH_MESSAGE_ID_MAX) data/notmuch-0.31.2/lib/database.cc:663: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). if (strlen (message_id) > NOTMUCH_MESSAGE_ID_MAX) data/notmuch-0.31.2/lib/database.cc:858: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). if (strlen (feature_names[i].name) == namelen && data/notmuch-0.31.2/lib/database.cc:1646:3: [1] (buffer) strlen: Does not handle 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 (NOTMUCH_METADATA_THREAD_ID_PREFIX)); data/notmuch-0.31.2/lib/database.cc:1789: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). int term_len = strlen (_find_prefix ("directory")) + strlen (path); data/notmuch-0.31.2/lib/database.cc:1789:58: [1] (buffer) strlen: Does not handle 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 term_len = strlen (_find_prefix ("directory")) + strlen (path); data/notmuch-0.31.2/lib/database.cc:1836: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). slash = path + strlen (path) - 1; data/notmuch-0.31.2/lib/database.cc:1968: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). db_path_len = strlen (db_path); data/notmuch-0.31.2/lib/database.cc:2119:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int prefix_len = strlen (prefix); data/notmuch-0.31.2/lib/message-file.c:72: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). if (strncmp (filename, prefix, strlen(prefix)) != 0) { data/notmuch-0.31.2/lib/message-id.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). for (r = result, len = strlen (r); *r; r++, len--) data/notmuch-0.31.2/lib/message.cc:268: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). if (strlen (message_id) > NOTMUCH_MESSAGE_ID_MAX) data/notmuch-0.31.2/lib/message.cc:312:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int prefix_len = strlen (prefix); data/notmuch-0.31.2/lib/message.cc:715: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). prefix_len = strlen (prefix); data/notmuch-0.31.2/lib/message.cc:860: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). if (strlen (directory)) { data/notmuch-0.31.2/lib/message.cc:868: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). for (p = path + strlen (path) - 1; p > path; p--) { data/notmuch-0.31.2/lib/message.cc:889:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int direntry_prefix_len = strlen (direntry_prefix); data/notmuch-0.31.2/lib/message.cc:1106: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). if (strlen (directory)) data/notmuch-0.31.2/lib/message.cc:1484: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). if (strlen (term) > NOTMUCH_TERM_MAX) data/notmuch-0.31.2/lib/message.cc:1552: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). if (strlen (term) > NOTMUCH_TERM_MAX) data/notmuch-0.31.2/lib/message.cc:1588: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). if (strlen (term) > NOTMUCH_TERM_MAX) data/notmuch-0.31.2/lib/message.cc:1621: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). if (strlen (tag) > NOTMUCH_TAG_MAX) data/notmuch-0.31.2/lib/message.cc:1656: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). if (strlen (tag) > NOTMUCH_TAG_MAX) data/notmuch-0.31.2/lib/message.cc:1920: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). info = filename + strlen (filename); data/notmuch-0.31.2/lib/message.cc:1972:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen (":2,") + flags_in_map + 1); data/notmuch-0.31.2/lib/message.cc:1976:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (filename_new, filename, info - filename); data/notmuch-0.31.2/lib/message.cc:1981: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). s = filename_new + strlen (filename_new); data/notmuch-0.31.2/lib/sha1.c:38: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). g_checksum_update (sha1, (const guchar *) str, strlen (str) + 1); data/notmuch-0.31.2/lib/string-map.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). return (strncmp (a, b, strlen (a))); data/notmuch-0.31.2/lib/thread.cc:200:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (comma && strlen (comma) > 1) { data/notmuch-0.31.2/lib/thread.cc:205: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). fname = strlen (author) - lname - 1; data/notmuch-0.31.2/lib/thread.cc:211:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (clean_author, comma, fname); data/notmuch-0.31.2/lib/thread.cc:214:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (clean_author + fname + 1, author, lname); data/notmuch-0.31.2/lib/thread.cc:338: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 (subject) - 4); data/notmuch-0.31.2/notmuch-client.h:106: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). if (str && str[strlen (str) - 1] == '\n') data/notmuch-0.31.2/notmuch-client.h:107: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). str[strlen (str) - 1] = '\0'; data/notmuch-0.31.2/notmuch-config.c:854: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 (config_key_table[i].name)) == 0) data/notmuch-0.31.2/notmuch-config.c:918: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). notmuch_built_with (item + strlen (BUILT_WITH_PREFIX)) ? "true" : "false"); data/notmuch-0.31.2/notmuch-insert.c:57:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy (hostname, "unknown", len); data/notmuch-0.31.2/notmuch-insert.c:258:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). remain = read (fdin, buf, sizeof (buf)); data/notmuch-0.31.2/notmuch-insert.c:343: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). memcpy (newpath + strlen (maildir) + 1, "new", 3); data/notmuch-0.31.2/notmuch-new.c:261:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen (s); data/notmuch-0.31.2/notmuch-new.c:315:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t db_path_len = strlen (db_path); data/notmuch-0.31.2/notmuch-setup.c:160: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). if (strlen (response)) data/notmuch-0.31.2/notmuch-setup.c:165: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). if (strlen (response)) data/notmuch-0.31.2/notmuch-setup.c:174: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). if (strlen (response)) data/notmuch-0.31.2/notmuch-setup.c:183: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). if (strlen (response)) data/notmuch-0.31.2/notmuch-setup.c:185: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). } while (strlen (response)); data/notmuch-0.31.2/notmuch-setup.c:195: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). if (strlen (response)) { data/notmuch-0.31.2/notmuch-setup.c:208: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). if (strlen (response)) { data/notmuch-0.31.2/notmuch-setup.c:224: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). if (strlen (response)) { data/notmuch-0.31.2/sprinter-json.c:124:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). json_string_len (sp, val, strlen (val)); data/notmuch-0.31.2/sprinter-sexp.c:139:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sexp_string_len (sp, val, strlen (val)); data/notmuch-0.31.2/sprinter-sexp.c:154: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). for (i = 0; i < strlen (val); i++) { data/notmuch-0.31.2/sprinter-text.c:44:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). text_string_len (sp, val, strlen (val)); data/notmuch-0.31.2/test/hex-xcode.c:32: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). *size_p = strlen (in); data/notmuch-0.31.2/test/message-id-parse.c:14: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). int last = strlen (line) - 1; data/notmuch-0.31.2/test/parse-time.c:66: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 (argv[i]) + 1; data/notmuch-0.31.2/test/parse-time.c:76: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 (p, " "); data/notmuch-0.31.2/util/gmime-extra.c:114:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (! fpr || strlen (fpr) < 16) data/notmuch-0.31.2/util/gmime-extra.c:117: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). return fpr + (strlen (fpr) - 16); data/notmuch-0.31.2/util/string-util.c:99: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). needed = strlen (term) + 1; data/notmuch-0.31.2/util/string-util.c:103: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). needed += strlen (prefix) + 1; data/notmuch-0.31.2/util/string-util.c:120: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). out += strlen (prefix); data/notmuch-0.31.2/util/string-util.c:174:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char *out = talloc_array (ctx, char, strlen (pos)); data/notmuch-0.31.2/util/string-util.c:266: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). for (i = strlen (str) - 1; i >= 0; i--) { data/notmuch-0.31.2/util/xutil.c:88: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). if (strlen (s) <= n) data/notmuch-0.31.2/util/xutil.c:89: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 (s); data/notmuch-0.31.2/util/zlib-extra.c:64:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). offset += strlen (buf + offset); ANALYSIS SUMMARY: Hits = 161 Lines analyzed = 33099 in approximately 0.93 seconds (35685 lines/second) Physical Source Lines of Code (SLOC) = 20464 Hits@level = [0] 369 [1] 84 [2] 37 [3] 18 [4] 21 [5] 1 Hits@level+ = [0+] 530 [1+] 161 [2+] 77 [3+] 40 [4+] 22 [5+] 1 Hits/KSLOC@level+ = [0+] 25.8991 [1+] 7.86747 [2+] 3.76271 [3+] 1.95465 [4+] 1.07506 [5+] 0.0488663 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.