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/flex-2.6.4/examples/fastwc/mywc.c Examining data/flex-2.6.4/tests/cxx_multiple_scanners_main.cc Examining data/flex-2.6.4/tests/bison_yylloc_main.c Examining data/flex-2.6.4/tests/top_main.c Examining data/flex-2.6.4/tests/multiple_scanners_nr_main.c Examining data/flex-2.6.4/tests/bison_nr_main.c Examining data/flex-2.6.4/tests/multiple_scanners_r_main.c Examining data/flex-2.6.4/tests/bison_yylval_main.c Examining data/flex-2.6.4/tests/header_nr_main.c Examining data/flex-2.6.4/tests/no_bison_stub.c Examining data/flex-2.6.4/tests/header_r_main.c Examining data/flex-2.6.4/src/parse.c Examining data/flex-2.6.4/src/scanflags.c Examining data/flex-2.6.4/src/tables.h Examining data/flex-2.6.4/src/skel.c Examining data/flex-2.6.4/src/ecs.c Examining data/flex-2.6.4/src/tables_shared.c Examining data/flex-2.6.4/src/sym.c Examining data/flex-2.6.4/src/FlexLexer.h Examining data/flex-2.6.4/src/tblcmp.c Examining data/flex-2.6.4/src/libyywrap.c Examining data/flex-2.6.4/src/scanopt.h Examining data/flex-2.6.4/src/flexint.h Examining data/flex-2.6.4/src/libmain.c Examining data/flex-2.6.4/src/yylex.c Examining data/flex-2.6.4/src/dfa.c Examining data/flex-2.6.4/src/parse.h Examining data/flex-2.6.4/src/version.h Examining data/flex-2.6.4/src/buf.c Examining data/flex-2.6.4/src/ccl.c Examining data/flex-2.6.4/src/filter.c Examining data/flex-2.6.4/src/flexdef.h Examining data/flex-2.6.4/src/gen.c Examining data/flex-2.6.4/src/gettext.h Examining data/flex-2.6.4/src/main.c Examining data/flex-2.6.4/src/misc.c Examining data/flex-2.6.4/src/nfa.c Examining data/flex-2.6.4/src/options.c Examining data/flex-2.6.4/src/options.h Examining data/flex-2.6.4/src/regex.c Examining data/flex-2.6.4/src/scan.c Examining data/flex-2.6.4/src/scanopt.c Examining data/flex-2.6.4/src/tables.c Examining data/flex-2.6.4/src/tables_shared.h Examining data/flex-2.6.4/lib/realloc.c Examining data/flex-2.6.4/lib/malloc.c FINAL RESULTS: data/flex-2.6.4/src/buf.c:80:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (t, tsz, fmt, s); data/flex-2.6.4/src/buf.c:179:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(str, strsz, fmt, def, val); data/flex-2.6.4/src/buf.c:200:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(str, strsz, fmt, def); data/flex-2.6.4/src/filter.c:180:4: [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 (chain->argv[0], data/flex-2.6.4/src/flexdef.h:828:9: [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/flex-2.6.4/src/flexdef.h:837:9: [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/flex-2.6.4/src/gen.c:882: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 (char_map, useecs ? data/flex-2.6.4/src/main.c:327:4: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (outfile_path, sizeof(outfile_path), outfile_template, data/flex-2.6.4/src/main.c:415:4: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (pname, nbytes, tablesfile_template, prefix); data/flex-2.6.4/src/main.c:475:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(str, strsz, fmt, scname[i], i - 1); data/flex-2.6.4/src/main.c:1801:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (outfile_path, sizeof(outfile_path), outfile_template, data/flex-2.6.4/src/misc.c:133: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 (&action_array[action_index], new_text); data/flex-2.6.4/src/misc.c:320: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 (errmsg, sizeof(errmsg), msg, args); data/flex-2.6.4/src/misc.c:334: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 (errmsg, sizeof(errmsg), msg, args); data/flex-2.6.4/src/misc.c:370:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (directive, sizeof(directive), line_fmt, linenum, filename); data/flex-2.6.4/src/misc.c:372:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (directive, sizeof(directive), line_fmt, 0, filename); data/flex-2.6.4/src/misc.c:564: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 (stdout, fmt, n); data/flex-2.6.4/src/misc.c:569: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 (stdout, fmt, n1, n2); data/flex-2.6.4/src/misc.c:574: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 (stdout, fmt, x); data/flex-2.6.4/src/misc.c:579: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 (stdout,fmt, str); data/flex-2.6.4/src/misc.c:584: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 (stdout,fmt, s1, s2, s3); data/flex-2.6.4/src/misc.c:589: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 (stdout,fmt, str, n); data/flex-2.6.4/src/misc.c:610: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(stdout, fmt, def, val?val:""); data/flex-2.6.4/src/parse.c:114:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\ data/flex-2.6.4/src/parse.c:851:21: [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 YYFPRINTF fprintf data/flex-2.6.4/src/parse.c:2863:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void) snprintf( errmsg, sizeof(errmsg), msg, arg ); data/flex-2.6.4/src/parse.c:2883:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( warn_msg, sizeof(warn_msg), msg, arg ); data/flex-2.6.4/src/parse.c:2903:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( errmsg, sizeof(errmsg), msg, arg ); data/flex-2.6.4/src/main.c:344: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. if ( !(m4 = getenv("M4"))) { data/flex-2.6.4/src/main.c:350: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 *path = getenv("PATH"); data/flex-2.6.4/src/main.c:1515:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv ("POSIXLY_CORRECT")) { data/flex-2.6.4/src/scan.c:1946:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ( getenv("POSIXLY_CORRECT") ) \ data/flex-2.6.4/src/scanopt.c:116:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((env = getenv ("COLUMNS")) != NULL) data/flex-2.6.4/src/buf.c:262: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 ((char *) buf->elts + (size_t) buf->nelts * buf->elt_size, ptr, data/flex-2.6.4/src/ecs.c:119:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char cclflags[CSIZE]; /* initialized to all '\0' */ data/flex-2.6.4/src/filter.c:231: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[512]; data/flex-2.6.4/src/filter.c:340: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[512]; data/flex-2.6.4/src/filter.c:370: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 filename[MAXLINE]; data/flex-2.6.4/src/flexdef.h:630: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. extern char nmstr[MAXLINE]; data/flex-2.6.4/src/gen.c:868: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 char_map[256]; data/flex-2.6.4/src/gen.c:981: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 NUL_ec_str[20]; data/flex-2.6.4/src/main.c:98:1: [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 nmstr[MAXLINE]; data/flex-2.6.4/src/main.c:126: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 outfile_path[MAXLINE]; data/flex-2.6.4/src/main.c:366:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(m4_path, path, endOfDir-path); data/flex-2.6.4/src/main.c:368:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(m4_path + (endOfDir-path) + 1, m4, m4_length + 1); data/flex-2.6.4/src/main.c:418:20: [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 ((tablesout = fopen (tablesfilename, "w")) == NULL) data/flex-2.6.4/src/main.c:434:30: [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 (skelname && (skelfile = fopen (skelname, "r")) == NULL) data/flex-2.6.4/src/main.c:1520:21: [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). backing_up_file = fopen (backing_name, "w"); data/flex-2.6.4/src/misc.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 buf[MAXLINE]; data/flex-2.6.4/src/misc.c:316: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 errmsg[MAXLINE]; data/flex-2.6.4/src/misc.c:330: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 errmsg[MAXLINE]; data/flex-2.6.4/src/misc.c:344: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 directive[MAXLINE], filename[MAXLINE]; data/flex-2.6.4/src/misc.c:621: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 rform[20]; data/flex-2.6.4/src/misc.c:693: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_storage[MAXLINE]; data/flex-2.6.4/src/misc.c:709:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. ((buf = (char *) skel[skel_ind++]) != 0)) { data/flex-2.6.4/src/nfa.c:197: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 action_text[MAXLINE]; data/flex-2.6.4/src/parse.c:113: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. char fw3_msg[MAXLINE];\ data/flex-2.6.4/src/parse.c:1097: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/flex-2.6.4/src/parse.c:1284: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 yymsgbuf[128]; data/flex-2.6.4/src/parse.c:2822: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 action_text[MAXLINE]; data/flex-2.6.4/src/parse.c:2861: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 errmsg[MAXLINE]; data/flex-2.6.4/src/parse.c:2881: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 warn_msg[MAXLINE]; data/flex-2.6.4/src/parse.c:2901: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 errmsg[MAXLINE]; data/flex-2.6.4/src/parse.c:2920: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 warning[MAXLINE]; data/flex-2.6.4/src/regex.c:134: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[bufsz]; data/flex-2.6.4/src/scan.c:2231: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 nmdef[MAXLINE]; data/flex-2.6.4/src/scan.c:5221: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). yyin = fopen( infilename, "r" ); data/flex-2.6.4/src/scanopt.c:117:10: [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). cols = atoi (env); data/flex-2.6.4/src/scanopt.c:463: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 optchar[2]; data/flex-2.6.4/src/tblcmp.c:678: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 transset[CSIZE + 1]; data/flex-2.6.4/examples/fastwc/mywc.c:11:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(f)) != EOF) { data/flex-2.6.4/examples/fastwc/mywc.c:16:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(f); data/flex-2.6.4/src/buf.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). tsz = strlen(fmt) + strlen(s) + 1; data/flex-2.6.4/src/buf.c:76: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). tsz = strlen(fmt) + strlen(s) + 1; data/flex-2.6.4/src/buf.c:101: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). tsz = strlen("#line \"\"\n") + /* constant parts */ data/flex-2.6.4/src/buf.c:102: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). 2 * strlen (filename) + /* filename with possibly all backslashes escaped */ data/flex-2.6.4/src/buf.c:146:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return buf_strnappend (buf, str, (int) strlen (str)); data/flex-2.6.4/src/buf.c:174: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). strsz = strlen(fmt) + strlen(def) + strlen(val) + 2; data/flex-2.6.4/src/buf.c:174:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strsz = strlen(fmt) + strlen(def) + strlen(val) + 2; data/flex-2.6.4/src/buf.c:174:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strsz = strlen(fmt) + strlen(def) + strlen(val) + 2; data/flex-2.6.4/src/buf.c:195: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). strsz = strlen(fmt) + strlen(def) + 2; data/flex-2.6.4/src/buf.c:195:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strsz = strlen(fmt) + strlen(def) + 2; data/flex-2.6.4/src/filter.c:169:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (void)fgetc(stdin); /* on NetBSD than the fseek attempt does */ data/flex-2.6.4/src/main.c:354: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). int m4_length = strlen(m4); data/flex-2.6.4/src/main.c:356: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 length = strlen(path); data/flex-2.6.4/src/main.c:413: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). nbytes = strlen (prefix) + strlen (tablesfile_template) + 2; data/flex-2.6.4/src/main.c:413: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). nbytes = strlen (prefix) + strlen (tablesfile_template) + 2; data/flex-2.6.4/src/main.c:425: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). nbytes = strlen (prefix) + strlen ("tables") + 2; data/flex-2.6.4/src/main.c:425: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). nbytes = strlen (prefix) + strlen ("tables") + 2; data/flex-2.6.4/src/main.c:471: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). strsz = strlen(fmt) + strlen(scname[i]) + (size_t)(1 + ceil (log10(i))) + 2; data/flex-2.6.4/src/main.c:471: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). strsz = strlen(fmt) + strlen(scname[i]) + (size_t)(1 + ceil (log10(i))) + 2; data/flex-2.6.4/src/main.c:1002: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). program_name[strlen (program_name) - 1] == '+') data/flex-2.6.4/src/misc.c:98: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). if ((int) strlen (defname) > MAXLINE / 2) { data/flex-2.6.4/src/misc.c:116: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 len = (int) strlen (new_text); data/flex-2.6.4/src/misc.c:718: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). if (buf[strlen (buf) - 1] == '\\') data/flex-2.6.4/src/misc.c:729: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). #define cmd_match(s) (strncmp(buf,(s),strlen(s))==0) data/flex-2.6.4/src/misc.c:743:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). out_str("%s\n", buf[strlen (buf) - 1] =='\\' ? "\\" : ""); data/flex-2.6.4/src/misc.c:750:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). out_str("%s\n", buf[strlen (buf) - 1] =='\\' ? "\\" : ""); data/flex-2.6.4/src/parse.c:997: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). # define yystrlen strlen data/flex-2.6.4/src/regex.c:83:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (str, src + m->rm_so, len); data/flex-2.6.4/src/scan.c:1922:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( nmstr, yytext, sizeof(nmstr) ); \ data/flex-2.6.4/src/scan.c:1932: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 i = strlen( str ); \ data/flex-2.6.4/src/scan.c:2112:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/flex-2.6.4/src/scan.c:2399:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( nmstr, yytext, sizeof(nmstr) ); data/flex-2.6.4/src/scan.c:2521: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). infilename[strlen( infilename ) - 1] = '\0'; data/flex-2.6.4/src/scan.c:2602: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). buf_strnappend(&top_buf, escaped_qstart, (int) strlen(escaped_qstart)); data/flex-2.6.4/src/scan.c:2607:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf_strnappend(&top_buf, escaped_qend, (int) strlen(escaped_qend)); data/flex-2.6.4/src/scan.c:2637:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( nmdef, yytext, sizeof(nmdef) ); data/flex-2.6.4/src/scan.c:2646:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t i = strlen( nmdef ); data/flex-2.6.4/src/scan.c:3079:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( nmstr, yytext + 1, sizeof(nmstr) ); data/flex-2.6.4/src/scan.c:3086: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). nmstr[strlen( nmstr ) - 1] = '\0'; data/flex-2.6.4/src/scan.c:3350:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( nmstr, yytext, sizeof(nmstr) ); data/flex-2.6.4/src/scan.c:3419:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy( nmstr, yytext + 1, sizeof(nmstr) ); data/flex-2.6.4/src/scan.c:3435: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). size_t len = strlen( nmdefptr ); data/flex-2.6.4/src/scan.c:4909:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return yy_scan_bytes( yystr, (int) strlen(yystr) ); data/flex-2.6.4/src/scanopt.c:181: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). aux->printlen = (int) strlen (opt->opt_fmt); data/flex-2.6.4/src/scanopt.c:321: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). len += PRINTLEN(s, ap->idx) + (int) strlen(", "); data/flex-2.6.4/src/scanopt.c:328: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). len = (int) strlen (DESC (s, ue->idx)); data/flex-2.6.4/src/scanopt.c:701: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). arglen = (int) strlen (optarg); data/flex-2.6.4/src/tables.c:89: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). th->th_hsize = (flex_uint32_t) (14 + strlen (version_str) + 1 + strlen (name) + 1); data/flex-2.6.4/src/tables.c:89:66: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). th->th_hsize = (flex_uint32_t) (14 + strlen (version_str) + 1 + strlen (name) + 1); data/flex-2.6.4/src/tables.c:161: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). sz = (int) strlen (th->th_version) + 1; data/flex-2.6.4/src/tables.c:166: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). sz = (int) strlen (th->th_name) + 1; ANALYSIS SUMMARY: Hits = 123 Lines analyzed = 26132 in approximately 1.64 seconds (15910 lines/second) Physical Source Lines of Code (SLOC) = 18437 Hits@level = [0] 170 [1] 53 [2] 37 [3] 5 [4] 28 [5] 0 Hits@level+ = [0+] 293 [1+] 123 [2+] 70 [3+] 33 [4+] 28 [5+] 0 Hits/KSLOC@level+ = [0+] 15.892 [1+] 6.67137 [2+] 3.79671 [3+] 1.78988 [4+] 1.51869 [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.