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/bc-1.07.1/lib/getopt.c Examining data/bc-1.07.1/lib/getopt1.c Examining data/bc-1.07.1/lib/vfprintf.c Examining data/bc-1.07.1/lib/testmul.c Examining data/bc-1.07.1/lib/number.c Examining data/bc-1.07.1/bc/bc.h Examining data/bc-1.07.1/bc/load.c Examining data/bc-1.07.1/bc/storage.c Examining data/bc-1.07.1/bc/global.c Examining data/bc-1.07.1/bc/warranty.c Examining data/bc-1.07.1/bc/bcdefs.h Examining data/bc-1.07.1/bc/const.h Examining data/bc-1.07.1/bc/global.h Examining data/bc-1.07.1/bc/proto.h Examining data/bc-1.07.1/bc/bc.c Examining data/bc-1.07.1/bc/execute.c Examining data/bc-1.07.1/bc/main.c Examining data/bc-1.07.1/bc/scan.c Examining data/bc-1.07.1/bc/util.c Examining data/bc-1.07.1/dc/dc.h Examining data/bc-1.07.1/dc/dc-proto.h Examining data/bc-1.07.1/dc/dc-regdef.h Examining data/bc-1.07.1/dc/array.c Examining data/bc-1.07.1/dc/eval.c Examining data/bc-1.07.1/dc/misc.c Examining data/bc-1.07.1/dc/numeric.c Examining data/bc-1.07.1/dc/stack.c Examining data/bc-1.07.1/dc/string.c Examining data/bc-1.07.1/dc/dc.c Examining data/bc-1.07.1/h/getopt.h Examining data/bc-1.07.1/h/number.h FINAL RESULTS: data/bc-1.07.1/bc/bc.c:910: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/bc-1.07.1/bc/util.c:48:11: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). return (strcpy (temp,str)); data/bc-1.07.1/bc/util.c:109:10: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). temp = strcat (temp, sval); data/bc-1.07.1/bc/util.c:710: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, str, args); data/bc-1.07.1/bc/util.c:751:7: [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, mesg, args); data/bc-1.07.1/bc/util.c:764:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, mesg, args); data/bc-1.07.1/bc/util.c:797: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, mesg, args); data/bc-1.07.1/bc/util.c:832: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, mesg, args); data/bc-1.07.1/dc/dc.c:266:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(rcfile, "%s/.dcrc", homedir); data/bc-1.07.1/dc/misc.c:141:3: [4] (shell) system: 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. system(tmpstr); data/bc-1.07.1/dc/misc.c:145:2: [4] (shell) system: 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. system(s); data/bc-1.07.1/dc/numeric.c:633:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, mesg, args); data/bc-1.07.1/dc/numeric.c:667:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, mesg, args); data/bc-1.07.1/lib/testmul.c:58:3: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf (error_mesg, mesg, args); data/bc-1.07.1/lib/testmul.c:91:3: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf (error_mesg, mesg, args); data/bc-1.07.1/lib/vfprintf.c:7:14: [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. #error need vfprintf() or doprint() data/bc-1.07.1/lib/vfprintf.c:20:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. int vfprintf(file, format, argp) data/bc-1.07.1/bc/execute.c:299:34: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. bc_int2num (&ex_stack->s_num, random()); data/bc-1.07.1/bc/main.c:93:15: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. optch = getopt_long (argc, argv, "chilqswv", long_options, &long_index); data/bc-1.07.1/bc/main.c:180:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_value = getenv ("BC_ENV_ARGS"); data/bc-1.07.1/bc/main.c:208: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") != NULL) data/bc-1.07.1/bc/main.c:211:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_value = getenv ("BC_LINE_LENGTH"); data/bc-1.07.1/bc/proto.h:138:6: [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. (int getopt (int, char *[], CONST char *); data/bc-1.07.1/dc/dc.c:259: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. homedir=getenv("HOME"); data/bc-1.07.1/dc/dc.c:298:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "hVe:f:", long_opts, (int *)0)) != EOF) { data/bc-1.07.1/dc/numeric.c:559:29: [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 *env_line_len = getenv("DC_LINE_LENGTH"); data/bc-1.07.1/h/getopt.h:142:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); data/bc-1.07.1/h/getopt.h:144:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/bc-1.07.1/h/getopt.h:148:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int ___argc, char *const *___argv, data/bc-1.07.1/lib/getopt.c:199: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. #ifndef getenv data/bc-1.07.1/lib/getopt.c:200:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. extern char *getenv (); data/bc-1.07.1/lib/getopt.c:348:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. posixly_correct = getenv ("POSIXLY_CORRECT"); data/bc-1.07.1/lib/getopt.c:1135:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (int argc, char *const *argv, const char *optstring) data/bc-1.07.1/lib/getopt.c:1160:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt (argc, argv, "abc:d:0123456789"); data/bc-1.07.1/lib/getopt1.c:64:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long (int argc, data/bc-1.07.1/lib/getopt1.c:89:18: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. libc_hidden_def (getopt_long) data/bc-1.07.1/lib/getopt1.c:120:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "abc:d:0123456789", data/bc-1.07.1/bc/bc.c:1156: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/bc-1.07.1/bc/bc.c:1343: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/bc-1.07.1/bc/load.c:69:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_body, f->f_body, f->f_body_size/2); data/bc-1.07.1/bc/main.c:167: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 *env_argv[30]; data/bc-1.07.1/bc/main.c:214:19: [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). line_size = atoi (env_value); data/bc-1.07.1/bc/main.c:312:18: [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). new_file = fopen (file_names->name, "r"); data/bc-1.07.1/bc/util.c:86: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 sval[30]; data/bc-1.07.1/dc/dc.c:117: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). } else if ( (input=fopen(filename, "r")) == NULL ) { data/bc-1.07.1/dc/dc.c:267:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(input=fopen(rcfile, "r"))) data/bc-1.07.1/dc/string.c:116: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(string->s_ptr, s, len); data/bc-1.07.1/lib/number.c:878: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 (result, num, size); data/bc-1.07.1/lib/number.c:928: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 (qval->n_value, n1->n_value, data/bc-1.07.1/lib/number.c:950: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 (num1+1, n1->n_value, n1->n_len+n1->n_scale); data/bc-1.07.1/lib/number.c:955: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 (num2, n2->n_value, len2); data/bc-1.07.1/lib/number.c:1394: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 digits[40]; data/bc-1.07.1/lib/number.c:1563:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[30]; data/bc-1.07.1/lib/testmul.c:51: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 error_mesg [255]; data/bc-1.07.1/lib/testmul.c:84: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 error_mesg [255]; data/bc-1.07.1/bc/bc.c:1056: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/bc-1.07.1/bc/bc.c:1869:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). set_genstr_size (30 + strlen (params) data/bc-1.07.1/bc/bc.c:1870: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). + strlen (autos)); data/bc-1.07.1/bc/bc.c:2304:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen((yyvsp[0].s_value)); data/bc-1.07.1/bc/bc.c:2341:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). set_genstr_size (20 + strlen (params)); data/bc-1.07.1/bc/execute.c:583:11: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in_ch = getchar(); data/bc-1.07.1/bc/execute.c:588:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in_ch = getchar(); data/bc-1.07.1/bc/execute.c:590:12: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in_ch = getchar(); data/bc-1.07.1/bc/scan.c:771:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (rdsize = read( fileno(yyin), buf, max )) < 0 ) data/bc-1.07.1/bc/scan.c:799:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, bcel_line, bcel_len); data/bc-1.07.1/bc/scan.c:805:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, bcel_line, max); data/bc-1.07.1/bc/scan.c:840:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (*result = read( fileno(yyin), buf, max )) < 0 ) data/bc-1.07.1/bc/scan.c:862: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). rl_len = strlen (rl_line)+1; data/bc-1.07.1/bc/scan.c:872:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, rl_line, rl_len); data/bc-1.07.1/bc/scan.c:878:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buf, rl_line, max); data/bc-1.07.1/bc/scan.c:893:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ data/bc-1.07.1/bc/scan.c:1006: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/bc-1.07.1/bc/scan.c:1460:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(yytext); data/bc-1.07.1/bc/scan.c:2265:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return yy_scan_bytes(yystr,strlen(yystr) ); data/bc-1.07.1/bc/util.c:47: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). temp = bc_malloc (strlen (str)+1); data/bc-1.07.1/bc/util.c:270: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). out_count += strlen(str); data/bc-1.07.1/bc/util.c:546: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). if (strlen(name) != 1) data/bc-1.07.1/dc/dc.c:128:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(input); data/bc-1.07.1/dc/dc.c:265: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). rcfile=malloc(strlen(homedir)+8); data/bc-1.07.1/dc/dc.c:301:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). { dc_data string = dc_makestring(optarg, strlen(optarg)); data/bc-1.07.1/dc/eval.c:106:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(input_fil_fp); data/bc-1.07.1/dc/eval.c:709:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (c=getc(fp); c!=EOF; c=peekc){ data/bc-1.07.1/dc/eval.c:710:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:738:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:743:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:749:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:758:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:785:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:804:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:813:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:817:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/eval.c:819:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). peekc = getc(fp); data/bc-1.07.1/dc/misc.c:139:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmpstr, s, len); data/bc-1.07.1/dc/misc.c:146: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). return s + strlen(s); data/bc-1.07.1/dc/string.c:152:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(fp); data/bc-1.07.1/lib/getopt.c:379:44: [1] (buffer) strlen: Does not handle 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 = nonoption_flags_max_len = strlen (orig_str); data/bc-1.07.1/lib/getopt.c:604:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). == (unsigned int) strlen (p->name)) data/bc-1.07.1/lib/getopt.c:649: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:715: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:749: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:754: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:941:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/bc-1.07.1/lib/getopt.c:981: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:1019: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:1051: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/getopt.c:1055: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). nextchar += strlen (nextchar); data/bc-1.07.1/lib/number.c:1399: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 (digits); ANALYSIS SUMMARY: Hits = 107 Lines analyzed = 16484 in approximately 0.42 seconds (39717 lines/second) Physical Source Lines of Code (SLOC) = 11534 Hits@level = [0] 189 [1] 52 [2] 18 [3] 20 [4] 17 [5] 0 Hits@level+ = [0+] 296 [1+] 107 [2+] 55 [3+] 37 [4+] 17 [5+] 0 Hits/KSLOC@level+ = [0+] 25.6633 [1+] 9.27692 [2+] 4.76851 [3+] 3.20791 [4+] 1.4739 [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.