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/mdocml-1.14.4/compat_fts.h Examining data/mdocml-1.14.4/compat_ohash.h Examining data/mdocml-1.14.4/compat_stringlist.h Examining data/mdocml-1.14.4/dba.h Examining data/mdocml-1.14.4/dba_array.h Examining data/mdocml-1.14.4/dba_write.h Examining data/mdocml-1.14.4/dbm.h Examining data/mdocml-1.14.4/dbm_map.h Examining data/mdocml-1.14.4/html.h Examining data/mdocml-1.14.4/libman.h Examining data/mdocml-1.14.4/libmandoc.h Examining data/mdocml-1.14.4/libmdoc.h Examining data/mdocml-1.14.4/libroff.h Examining data/mdocml-1.14.4/main.h Examining data/mdocml-1.14.4/man.h Examining data/mdocml-1.14.4/manconf.h Examining data/mdocml-1.14.4/mandoc.h Examining data/mdocml-1.14.4/mandoc_aux.h Examining data/mdocml-1.14.4/mandoc_ohash.h Examining data/mdocml-1.14.4/mandoc_xr.h Examining data/mdocml-1.14.4/mansearch.h Examining data/mdocml-1.14.4/mdoc.h Examining data/mdocml-1.14.4/out.h Examining data/mdocml-1.14.4/roff.h Examining data/mdocml-1.14.4/roff_int.h Examining data/mdocml-1.14.4/tag.h Examining data/mdocml-1.14.4/term.h Examining data/mdocml-1.14.4/att.c Examining data/mdocml-1.14.4/catman.c Examining data/mdocml-1.14.4/cgi.c Examining data/mdocml-1.14.4/chars.c Examining data/mdocml-1.14.4/compat_err.c Examining data/mdocml-1.14.4/compat_fts.c Examining data/mdocml-1.14.4/compat_ohash.c Examining data/mdocml-1.14.4/compat_getline.c Examining data/mdocml-1.14.4/compat_getsubopt.c Examining data/mdocml-1.14.4/compat_isblank.c Examining data/mdocml-1.14.4/compat_mkdtemp.c Examining data/mdocml-1.14.4/compat_progname.c Examining data/mdocml-1.14.4/compat_reallocarray.c Examining data/mdocml-1.14.4/compat_recallocarray.c Examining data/mdocml-1.14.4/compat_strcasestr.c Examining data/mdocml-1.14.4/compat_stringlist.c Examining data/mdocml-1.14.4/compat_strlcat.c Examining data/mdocml-1.14.4/compat_strlcpy.c Examining data/mdocml-1.14.4/compat_strndup.c Examining data/mdocml-1.14.4/compat_strsep.c Examining data/mdocml-1.14.4/compat_strtonum.c Examining data/mdocml-1.14.4/compat_vasprintf.c Examining data/mdocml-1.14.4/dba.c Examining data/mdocml-1.14.4/dba_array.c Examining data/mdocml-1.14.4/dba_read.c Examining data/mdocml-1.14.4/dba_write.c Examining data/mdocml-1.14.4/dbm.c Examining data/mdocml-1.14.4/dbm_map.c Examining data/mdocml-1.14.4/demandoc.c Examining data/mdocml-1.14.4/eqn.c Examining data/mdocml-1.14.4/eqn_html.c Examining data/mdocml-1.14.4/eqn_term.c Examining data/mdocml-1.14.4/html.c Examining data/mdocml-1.14.4/lib.c Examining data/mdocml-1.14.4/main.c Examining data/mdocml-1.14.4/man.c Examining data/mdocml-1.14.4/man_html.c Examining data/mdocml-1.14.4/man_macro.c Examining data/mdocml-1.14.4/man_term.c Examining data/mdocml-1.14.4/man_validate.c Examining data/mdocml-1.14.4/mandoc.c Examining data/mdocml-1.14.4/mandoc_aux.c Examining data/mdocml-1.14.4/mandoc_ohash.c Examining data/mdocml-1.14.4/mandoc_xr.c Examining data/mdocml-1.14.4/mandocd.c Examining data/mdocml-1.14.4/mandocdb.c Examining data/mdocml-1.14.4/manpath.c Examining data/mdocml-1.14.4/mansearch.c Examining data/mdocml-1.14.4/mdoc.c Examining data/mdocml-1.14.4/mdoc_argv.c Examining data/mdocml-1.14.4/mdoc_html.c Examining data/mdocml-1.14.4/mdoc_macro.c Examining data/mdocml-1.14.4/mdoc_man.c Examining data/mdocml-1.14.4/mdoc_markdown.c Examining data/mdocml-1.14.4/mdoc_state.c Examining data/mdocml-1.14.4/mdoc_term.c Examining data/mdocml-1.14.4/mdoc_validate.c Examining data/mdocml-1.14.4/msec.c Examining data/mdocml-1.14.4/out.c Examining data/mdocml-1.14.4/preconv.c Examining data/mdocml-1.14.4/read.c Examining data/mdocml-1.14.4/roff.c Examining data/mdocml-1.14.4/roff_html.c Examining data/mdocml-1.14.4/roff_term.c Examining data/mdocml-1.14.4/roff_validate.c Examining data/mdocml-1.14.4/soelim.c Examining data/mdocml-1.14.4/st.c Examining data/mdocml-1.14.4/tag.c Examining data/mdocml-1.14.4/tbl.c Examining data/mdocml-1.14.4/tbl_data.c Examining data/mdocml-1.14.4/tbl_html.c Examining data/mdocml-1.14.4/tbl_layout.c Examining data/mdocml-1.14.4/tbl_opts.c Examining data/mdocml-1.14.4/tbl_term.c Examining data/mdocml-1.14.4/term.c Examining data/mdocml-1.14.4/term_ascii.c Examining data/mdocml-1.14.4/term_ps.c Examining data/mdocml-1.14.4/term_tab.c Examining data/mdocml-1.14.4/tree.c Examining data/mdocml-1.14.4/test-be32toh.c Examining data/mdocml-1.14.4/test-cmsg.c Examining data/mdocml-1.14.4/test-dirent-namlen.c Examining data/mdocml-1.14.4/test-EFTYPE.c Examining data/mdocml-1.14.4/test-err.c Examining data/mdocml-1.14.4/test-fts.c Examining data/mdocml-1.14.4/test-getline.c Examining data/mdocml-1.14.4/test-getsubopt.c Examining data/mdocml-1.14.4/test-isblank.c Examining data/mdocml-1.14.4/test-mkdtemp.c Examining data/mdocml-1.14.4/test-nanosleep.c Examining data/mdocml-1.14.4/test-noop.c Examining data/mdocml-1.14.4/test-ntohl.c Examining data/mdocml-1.14.4/test-O_DIRECTORY.c Examining data/mdocml-1.14.4/test-ohash.c Examining data/mdocml-1.14.4/test-PATH_MAX.c Examining data/mdocml-1.14.4/test-pledge.c Examining data/mdocml-1.14.4/test-progname.c Examining data/mdocml-1.14.4/test-recvmsg.c Examining data/mdocml-1.14.4/test-reallocarray.c Examining data/mdocml-1.14.4/test-recallocarray.c Examining data/mdocml-1.14.4/test-rewb-bsd.c Examining data/mdocml-1.14.4/test-rewb-sysv.c Examining data/mdocml-1.14.4/test-sandbox_init.c Examining data/mdocml-1.14.4/test-strcasestr.c Examining data/mdocml-1.14.4/test-stringlist.c Examining data/mdocml-1.14.4/test-strlcat.c Examining data/mdocml-1.14.4/test-strlcpy.c Examining data/mdocml-1.14.4/test-strndup.c Examining data/mdocml-1.14.4/test-strptime.c Examining data/mdocml-1.14.4/test-strsep.c Examining data/mdocml-1.14.4/test-strtonum.c Examining data/mdocml-1.14.4/test-vasprintf.c Examining data/mdocml-1.14.4/test-wchar.c FINAL RESULTS: data/mdocml-1.14.4/catman.c:60:3: [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. execlp("mandocd", "mandocd", "-T", outtype, data/mdocml-1.14.4/catman.c:63:3: [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. execlp("mandocd", "mandocd", "-T", outtype, data/mdocml-1.14.4/cgi.c:1077:31: [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. *req.q.query == '\0' || access(path, F_OK) == -1) data/mdocml-1.14.4/compat_err.c:53:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/mdocml-1.14.4/compat_mkdtemp.c:46:7: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). if (mktemp(path) == NULL) { data/mdocml-1.14.4/compat_vasprintf.c:44:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. sz = vsnprintf(buf, sizeof(buf), format, ap2); data/mdocml-1.14.4/compat_vasprintf.c:48:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. if (vsnprintf(*ret, sz + 1, format, ap) == sz) data/mdocml-1.14.4/main.c:398: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(argv[c], R_OK) == -1) { data/mdocml-1.14.4/main.c:706:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(file, R_OK) != -1) data/mdocml-1.14.4/main.c:712:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(file, R_OK) != -1) { data/mdocml-1.14.4/main.c:721:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(file, R_OK) != -1) data/mdocml-1.14.4/main.c:741:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. globres = access(file, R_OK); data/mdocml-1.14.4/main.c:1251:2: [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/mdocml-1.14.4/mandocdb.c:2355:3: [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, ap); data/mdocml-1.14.4/mansearch.c:191:8: [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(chdir_status ? page->file + 1 : data/mdocml-1.14.4/read.c:875:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void)vsnprintf(buf, sizeof(buf), fmt, ap); data/mdocml-1.14.4/term_ps.c:671:9: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. len = vprintf(fmt, ap); data/mdocml-1.14.4/term_ps.c:686:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(&p->ps->psmarg[pos], PS_BUFSLOP, fmt, ap); data/mdocml-1.14.4/catman.c:210:16: [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. while ((opt = getopt(argc, argv, "I:T:")) != -1) { data/mdocml-1.14.4/cgi.c:1069: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. if ((path = getenv("PATH_INFO")) == NULL) data/mdocml-1.14.4/cgi.c:1079:28: [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 ((querystring = getenv("QUERY_STRING")) != NULL) data/mdocml-1.14.4/demandoc.c:59:21: [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. while (-1 != (ch = getopt(argc, argv, "ikm:pw"))) data/mdocml-1.14.4/main.c:204:14: [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. while ((c = getopt(argc, argv, data/mdocml-1.14.4/main.c:367:18: [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. search.arch = getenv("MACHINE"); data/mdocml-1.14.4/main.c:1186: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. pager = getenv("MANPAGER"); data/mdocml-1.14.4/main.c:1188: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. pager = getenv("PAGER"); data/mdocml-1.14.4/mandocd.c:133:16: [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. while ((opt = getopt(argc, argv, "I:T:")) != -1) { data/mdocml-1.14.4/mandocdb.c:353:21: [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. while (-1 != (ch = getopt(argc, argv, "aC:Dd:npQT:tu:v"))) data/mdocml-1.14.4/mandocdb.c:606:8: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(path, buf) == NULL) { data/mdocml-1.14.4/mandocdb.c:813:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (NULL == realpath(file, buf)) { data/mdocml-1.14.4/mandocdb.c:2297:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (NULL == realpath(targetdir, basedir)) { data/mdocml-1.14.4/manpath.c:56: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. defp = getenv("MANPATH"); data/mdocml-1.14.4/manpath.c:128:20: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (NULL == (cp = realpath(dir, buf))) { data/mdocml-1.14.4/soelim.c:151:15: [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. while ((ch = getopt(argc, argv, "CrtvI:")) != -1) { data/mdocml-1.14.4/catman.c:55: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 sockfdstr[10]; data/mdocml-1.14.4/catman.c:76: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 control[CMSG_SPACE(3 * sizeof(int))]; data/mdocml-1.14.4/catman.c:81:11: [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 dummy[1] = {'\0'}; data/mdocml-1.14.4/catman.c:127:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((in_fd = open(path, O_RDONLY)) == -1) { data/mdocml-1.14.4/catman.c:157: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. const char *argv[2]; data/mdocml-1.14.4/catman.c:245:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((dstdir_fd = open(argv[1], O_RDONLY | O_DIRECTORY)) == -1) data/mdocml-1.14.4/cgi.c:290: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 hex[3]; data/mdocml-1.14.4/cgi.c:336: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/mdocml-1.14.4/cgi.c:340: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). if ((fd = open(filename, O_RDONLY)) != -1) { data/mdocml-1.14.4/cgi.c:691:11: [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 ((f = fopen(file, "r")) == NULL) { data/mdocml-1.14.4/cgi.c:828: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 (-1 == (fd = open(file, O_RDONLY, 0))) { data/mdocml-1.14.4/cgi.c:1123: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 *dir[4]; data/mdocml-1.14.4/cgi.c:1205: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). if ((fp = fopen("manpath.conf", "r")) == NULL) { data/mdocml-1.14.4/chars.c:35: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. const char roffcode[16]; data/mdocml-1.14.4/chars.c:41:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char ascii_nbrsp[2] = { ASCII_NBRSP, '\0' }; data/mdocml-1.14.4/chars.c:42:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char ascii_break[2] = { ASCII_BREAK, '\0' }; data/mdocml-1.14.4/compat_fts.c:613: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(p->fts_name, name, namelen); data/mdocml-1.14.4/compat_fts.h:95: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 fts_name[1]; /* file name */ data/mdocml-1.14.4/compat_ohash.c:62: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(p+i->key_offset, start, *end-start); data/mdocml-1.14.4/compat_recallocarray.c:89: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(newptr, ptr, oldsize); data/mdocml-1.14.4/compat_recallocarray.c:92: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(newptr, ptr, newsize); data/mdocml-1.14.4/compat_strndup.c:43:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void)memcpy(copy, str, len); data/mdocml-1.14.4/compat_vasprintf.c:39: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[2]; data/mdocml-1.14.4/dba.c:253: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(outstr + 1, instr, newlen); data/mdocml-1.14.4/dba.c:351: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(&entry->value, value, len); data/mdocml-1.14.4/dba_write.c:46:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofp = fopen(fname, "w"); data/mdocml-1.14.4/dbm_map.c:65:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ifd = open(fname, O_RDONLY)) == -1) data/mdocml-1.14.4/eqn.c:93:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *eqn_toks[EQN_TOK__MAX] = { data/mdocml-1.14.4/eqn.c: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(ep->start, def->val, def->valsz); data/mdocml-1.14.4/html.c:347: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 numbuf[16]; data/mdocml-1.14.4/html.c:353:15: [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 rejs[10] = { ' ', '\\', '<', '>', '&', '"', data/mdocml-1.14.4/html.h:100: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[80]; /* output buffer */ data/mdocml-1.14.4/main.c:358:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((uc = (unsigned char *)argv[0]) != NULL) && data/mdocml-1.14.4/main.c:508:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). startdir = open(".", O_RDONLY | O_DIRECTORY); data/mdocml-1.14.4/main.c:1096: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. const char *toks[11]; data/mdocml-1.14.4/main.c:1179:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[MAX_PAGER_ARGS]; data/mdocml-1.14.4/mandoc.c:611: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[32]; data/mdocml-1.14.4/mandoc.c:618: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(buf, p, sz); data/mdocml-1.14.4/mandoc_xr.c:85: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(xr->sec, sec, ssz); data/mdocml-1.14.4/mandoc_xr.c:86: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(xr->name, name, nsz); data/mdocml-1.14.4/mandocd.c:61:11: [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 dummy[1]; data/mdocml-1.14.4/mandocdb.c:95: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 file[PATH_MAX]; /* filename rel. to manpath */ data/mdocml-1.14.4/mandocdb.c:180: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. static char basedir[PATH_MAX]; /* current base directory */ data/mdocml-1.14.4/mandocdb.c:573: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[PATH_MAX]; data/mdocml-1.14.4/mandocdb.c:581: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. const char *argv[2]; data/mdocml-1.14.4/mandocdb.c:782: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[PATH_MAX]; data/mdocml-1.14.4/mandocdb.c:1016: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[PATH_MAX]; data/mdocml-1.14.4/mandocdb.c:1031: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(bufp, "man", 3); data/mdocml-1.14.4/mandocdb.c:1260:22: [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). stream = fd == -1 ? fopen(mlink->file, "r") : fdopen(fd, "r"); data/mdocml-1.14.4/mandocdb.c:1325: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(title + titlesz, line + offs, len - offs); data/mdocml-1.14.4/mandocdb.c:1832: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(s->key, cp, sz); data/mdocml-1.14.4/mandocdb.c:1849: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. utf8(unsigned int cp, char out[7]) data/mdocml-1.14.4/mandocdb.c:1906: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 utfbuf[7], res[6]; data/mdocml-1.14.4/mandocdb.c:1940: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(dst, src, dsz); data/mdocml-1.14.4/mandocdb.c:2000: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(dst + dsz, addcp, addsz); data/mdocml-1.14.4/mandocdb.c:2145: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 tfn[33], *cp1, *cp2; data/mdocml-1.14.4/mandocdb.c:2193:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd1 = open(MANDOC_DB, O_RDONLY, 0)) == -1) { data/mdocml-1.14.4/mandocdb.c:2197:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd2 = open(tfn, O_RDONLY, 0)) == -1) { data/mdocml-1.14.4/mandocdb.c:2247:9: [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 startdir[PATH_MAX]; data/mdocml-1.14.4/manpath.c:123:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/mdocml-1.14.4/manpath.c:176: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). if ((stream = fopen(file, "r")) == NULL) data/mdocml-1.14.4/mansearch.c:56: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. const char *const mansearch_keynames[KEY_MAX] = { data/mdocml-1.14.4/mansearch.c:90:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/mdocml-1.14.4/mansearch.c:722: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 errbuf[BUFSIZ]; data/mdocml-1.14.4/mdoc.c:38: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. const char *const __mdoc_argnames[MDOC_ARG_MAX] = { data/mdocml-1.14.4/mdoc_argv.c:366: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(*retv + retc - 1, &tmpv, sizeof(**retv)); data/mdocml-1.14.4/mdoc_argv.c:602: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 dbuf[DELIMSZ]; data/mdocml-1.14.4/mdoc_html.c:749: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 cattr[28]; data/mdocml-1.14.4/mdoc_html.c:1136: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 nbuf[BUFSIZ]; data/mdocml-1.14.4/mdoc_html.c:1153: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. (void)memcpy(nbuf, sp, (size_t)sz); data/mdocml-1.14.4/mdoc_man.c:479: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[24]; data/mdocml-1.14.4/mdoc_man.c:531: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[24]; data/mdocml-1.14.4/mdoc_man.c:589: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[24]; data/mdocml-1.14.4/mdoc_man.c:1469: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[24]; data/mdocml-1.14.4/mdoc_term.c:612: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[24]; data/mdocml-1.14.4/mdoc_validate.c:262:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char * const secnames[SEC__MAX] = { data/mdocml-1.14.4/out.c:326: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[2]; data/mdocml-1.14.4/read.c:82:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char * const mandocerrs[MANDOCERR_MAX] = { data/mdocml-1.14.4/read.c:269:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char * const mandoclevels[MANDOCLEVEL_MAX] = { data/mdocml-1.14.4/read.c:460: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(curp->secondary->buf + data/mdocml-1.14.4/read.c:761: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). if ((fd = open(file, O_RDONLY)) != -1) data/mdocml-1.14.4/read.c:771: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(cp, O_RDONLY); data/mdocml-1.14.4/read.c:871:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/mdocml-1.14.4/roff.c:233: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. const char *__roff_name[MAN_MAX + 1] = { data/mdocml-1.14.4/roff.c:618: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(req->name, roff_name[tok], sz + 1); data/mdocml-1.14.4/roff.c:1124: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 ubuf[24]; /* buffer to print the number */ data/mdocml-1.14.4/roff.c:3310: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. const char *arg[16], *ap; data/mdocml-1.14.4/roff.c:3337: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(n1, r->current_string, buf->sz); data/mdocml-1.14.4/roff.c:3427: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(n2, "\\(dq", 4); data/mdocml-1.14.4/roff.c:3740: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(res + ssz, r->xtab[(int)*p].p, sz); data/mdocml-1.14.4/roff.c:3763: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(res + ssz, cp->val.p, cp->val.sz); data/mdocml-1.14.4/roff.c:3780: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(res + ssz, pp, sz); data/mdocml-1.14.4/roff.c:3790: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(res + ssz, pp, sz); data/mdocml-1.14.4/soelim.c:63: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 path[PATH_MAX]; data/mdocml-1.14.4/soelim.c:69:11: [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 ((f = fopen(name, "r")) != NULL) data/mdocml-1.14.4/soelim.c:80: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). if ((f = fopen(path, "r")) != NULL) data/mdocml-1.14.4/tag.c:91:13: [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). if ((ofd = mkstemp(tag_files.ofn)) == -1) data/mdocml-1.14.4/tag.c:93:23: [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). if ((tag_files.tfd = mkstemp(tag_files.tfn)) == -1) data/mdocml-1.14.4/tag.c:151: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(entry->s, s, len); data/mdocml-1.14.4/tag.h:19: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 ofn[20]; data/mdocml-1.14.4/tag.h:20:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tfn[20]; data/mdocml-1.14.4/tbl_term.c:564:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cp[2]; data/mdocml-1.14.4/tbl_term.c:623: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[2]; data/mdocml-1.14.4/term.c:437: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. const char nbrsp[2] = { ASCII_NBRSP, 0 }; data/mdocml-1.14.4/term_ascii.c:292:15: [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 nbrsp[2] = { ASCII_NBRSP, '\0' }; data/mdocml-1.14.4/test-O_DIRECTORY.c:6:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return open(".", O_RDONLY | O_DIRECTORY) == -1; data/mdocml-1.14.4/test-fts.c:16: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. const char *argv[2]; data/mdocml-1.14.4/test-strlcat.c:6: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[3] = "a"; data/mdocml-1.14.4/test-strlcpy.c:6: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[2] = ""; data/mdocml-1.14.4/test-strsep.c:6: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[6] = "aybxc"; data/mdocml-1.14.4/cgi.c:54:8: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. int equal; /* match whole names, not substrings */ data/mdocml-1.14.4/cgi.c:342:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((sz = read(fd, buf, sizeof(buf))) > 0) data/mdocml-1.14.4/cgi.c:612:13: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (req->q.equal || sz == 1) { data/mdocml-1.14.4/cgi.c:650:13: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); data/mdocml-1.14.4/cgi.c:673:13: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (req->q.equal || sz == 1) { data/mdocml-1.14.4/cgi.c:959:26: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. search.argmode = req->q.equal ? ARG_NAME : ARG_EXPR; data/mdocml-1.14.4/cgi.c:999:29: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (req->isquery && req->q.equal && argc == 1) data/mdocml-1.14.4/chars.c:498: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). *rsz = strlen(ln->ascii); data/mdocml-1.14.4/compat_fts.c:115: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 ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL) data/mdocml-1.14.4/compat_fts.c:183: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(++cp); data/mdocml-1.14.4/compat_fts.c:414: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). dlen = strlen(dp->d_name); data/mdocml-1.14.4/compat_fts.c:696:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(*argv)) > max) data/mdocml-1.14.4/compat_getline.c:57:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = fgetc(fp)) == EOF) { data/mdocml-1.14.4/compat_ohash.c:59: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). *end = start + strlen(start); data/mdocml-1.14.4/compat_ohash.c:221: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). *e = s + strlen(s); data/mdocml-1.14.4/compat_strcasestr.c:61: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(find); data/mdocml-1.14.4/compat_strlcat.c:52: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). return(dlen + strlen(s)); data/mdocml-1.14.4/dba.c:247: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). newlen = strlen(instr) + 1; data/mdocml-1.14.4/dba.c:349: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(value) + 1; data/mdocml-1.14.4/eqn.c:322: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). ep->sz = strlen(p); data/mdocml-1.14.4/eqn.c:437: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(ep->start + ep->toksz) + 1); data/mdocml-1.14.4/eqn.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). eqn_toks[tok], strlen(eqn_toks[tok]))) data/mdocml-1.14.4/eqn.c:454: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). eqnsyms[i].str, strlen(eqnsyms[i].str))) { data/mdocml-1.14.4/eqn.c:463: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). eqn_func[i], strlen(eqn_func[i]))) data/mdocml-1.14.4/main.c:1213:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((cmdlen = strlen(argv[0])) >= 4) { data/mdocml-1.14.4/man.c:132: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). i = (int)strlen(buf); data/mdocml-1.14.4/man_macro.c:250: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). *pos = strlen(buf); data/mdocml-1.14.4/man_macro.c:373:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mandoc_eos(man->last->string, strlen(man->last->string))) data/mdocml-1.14.4/mandoc.c:289:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((size_t)*sz > strlen(*start)) data/mdocml-1.14.4/mandoc_xr.c:75: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). ssz = strlen(sec) + 1; data/mdocml-1.14.4/mandoc_xr.c:76: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). nsz = strlen(name) + 1; data/mdocml-1.14.4/mandocdb.c:492: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). sz = strlen(conf.manpath.paths[j]); data/mdocml-1.14.4/mandocdb.c:671: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). strncmp(fsec, dsec, strlen(dsec))) || data/mdocml-1.14.4/mandocdb.c:822: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). start = buf + strlen(basedir); data/mdocml-1.14.4/mandocdb.c:854: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). start += strlen(basedir); data/mdocml-1.14.4/mandocdb.c:1364: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). plen = strlen(p); data/mdocml-1.14.4/mandocdb.c:1394: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). putkeys(mpage, value, strlen(value), type); data/mdocml-1.14.4/mandocdb.c:1623: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). if (0 == (sz = strlen(start))) data/mdocml-1.14.4/mandocdb.c:2082: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). i = strlen(cp); data/mdocml-1.14.4/manpath.c:74: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 (':' == defp[strlen(defp) - 1]) { data/mdocml-1.14.4/manpath.c:193: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). toklen = strlen(toks[tok]); data/mdocml-1.14.4/manpath.c:244: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(toks[tok]); data/mdocml-1.14.4/mdoc_macro.c:496:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (mandoc_eos(p, strlen(p))) data/mdocml-1.14.4/mdoc_markdown.c:630: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). outcount += strlen(seq); data/mdocml-1.14.4/mdoc_markdown.c:1278: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). i = i < nc ? strlen(bln->norm->Bl.cols[i]) - outcount + data/mdocml-1.14.4/mdoc_validate.c:442:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(np->string) - 1])) || data/mdocml-1.14.4/mdoc_validate.c:2333: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). dist += strlen(s1) + strlen(s2); data/mdocml-1.14.4/mdoc_validate.c:2333: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). dist += strlen(s1) + strlen(s2); data/mdocml-1.14.4/read.c:486: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). pos = strlen(ln.buf); data/mdocml-1.14.4/read.c:631:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, fb->buf + (int)off, fb->sz - off); data/mdocml-1.14.4/roff.c:615: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). sz = strlen(roff_name[tok]); data/mdocml-1.14.4/roff.c:1089: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). sz = strlen(cp); data/mdocml-1.14.4/roff.c:1398: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). } else if (buf->sz + strlen(res) > SHRT_MAX) { data/mdocml-1.14.4/roff.c:1413: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). stesc = nbuf + (stesc - buf->buf) + strlen(res); data/mdocml-1.14.4/roff.c:1808: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). namesz = strlen(name); data/mdocml-1.14.4/roff.c:1835: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). value, strlen(value), 0); data/mdocml-1.14.4/roff.c:1839: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)strlen(value), value); data/mdocml-1.14.4/roff.c:1877: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). namesz = strlen(name); data/mdocml-1.14.4/roff.c:1979: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). memmove(ep, ep + 2, strlen(ep + 2) + 1); data/mdocml-1.14.4/roff.c:2337: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). roff_setstrn(&r->strtab, name, namesz, string, strlen(string), data/mdocml-1.14.4/roff.c:2554: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). roff_setregn(r, name, strlen(name), val, sign, INT_MIN); data/mdocml-1.14.4/roff.c:2624: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). return roff_getregn(r, name, strlen(name), '\0'); data/mdocml-1.14.4/roff.c:3250:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). roff_setstrn(&r->strtab, newn, newsz, value, strlen(value), 0); data/mdocml-1.14.4/roff.c:3255:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). roff_setstrn(&r->strtab, newn, newsz, value, strlen(value), 0); data/mdocml-1.14.4/roff.c:3259:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). roff_setstrn(&r->rentab, newn, newsz, value, strlen(value), 0); data/mdocml-1.14.4/roff.c:3335: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). buf->sz = strlen(r->current_string) + 1; data/mdocml-1.14.4/roff.c:3518: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). namesz = strlen(name); data/mdocml-1.14.4/roff.c:3520: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). string ? strlen(string) : 0, append); data/mdocml-1.14.4/roff.c:3778: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). sz = strlen(pp); data/mdocml-1.14.4/tag.c:149: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(s) + 1; data/mdocml-1.14.4/tbl_data.c:159: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). sz = strlen(p + pos) + strlen(dat->string) + 2; data/mdocml-1.14.4/tbl_data.c:159: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). sz = strlen(p + pos) + strlen(dat->string) + 2; data/mdocml-1.14.4/tbl_html.c:46: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). return strlen(p); data/mdocml-1.14.4/term.c:590: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). ssz = strlen(cp); data/mdocml-1.14.4/term.c:638: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). encode(p, cp, strlen(cp)); data/mdocml-1.14.4/term.c:892: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). rsz = strlen(rhs); data/mdocml-1.14.4/term_ps.c:690: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). p->ps->psmargcur = strlen(p->ps->psmarg); ANALYSIS SUMMARY: Hits = 221 Lines analyzed = 45448 in approximately 1.13 seconds (40150 lines/second) Physical Source Lines of Code (SLOC) = 34421 Hits@level = [0] 152 [1] 77 [2] 110 [3] 16 [4] 18 [5] 0 Hits@level+ = [0+] 373 [1+] 221 [2+] 144 [3+] 34 [4+] 18 [5+] 0 Hits/KSLOC@level+ = [0+] 10.8364 [1+] 6.4205 [2+] 4.18349 [3+] 0.987769 [4+] 0.522937 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.