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/mpclib3-1.2.0/tools/mpcheck/mpcheck-float128.c Examining data/mpclib3-1.2.0/tools/mpcheck/mpcheck-double.c Examining data/mpclib3-1.2.0/tools/mpcheck/mpcheck-longdouble.c Examining data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float.c Examining data/mpclib3-1.2.0/tools/bench/benchtime.h Examining data/mpclib3-1.2.0/tools/bench/mpcbench.c Examining data/mpclib3-1.2.0/tests/tpow_fr.c Examining data/mpclib3-1.2.0/tests/copy_parameter.c Examining data/mpclib3-1.2.0/tests/tui_div.c Examining data/mpclib3-1.2.0/tests/tsqr.c Examining data/mpclib3-1.2.0/tests/tsum.c Examining data/mpclib3-1.2.0/tests/ttan.c Examining data/mpclib3-1.2.0/tests/tmul_fr.c Examining data/mpclib3-1.2.0/tests/tio_str.c Examining data/mpclib3-1.2.0/tests/tswap.c Examining data/mpclib3-1.2.0/tests/tmul_si.c Examining data/mpclib3-1.2.0/tests/tpl_native.c Examining data/mpclib3-1.2.0/tests/setprec_parameters.c Examining data/mpclib3-1.2.0/tests/tasinh.c Examining data/mpclib3-1.2.0/tests/timag.c Examining data/mpclib3-1.2.0/tests/exceptions.c Examining data/mpclib3-1.2.0/tests/tpow_ld.c Examining data/mpclib3-1.2.0/tests/check_data.c Examining data/mpclib3-1.2.0/tests/tdiv.c Examining data/mpclib3-1.2.0/tests/clear_parameters.c Examining data/mpclib3-1.2.0/tests/tpow_ui.c Examining data/mpclib3-1.2.0/tests/tset.c Examining data/mpclib3-1.2.0/tests/tabs.c Examining data/mpclib3-1.2.0/tests/tget_version.c Examining data/mpclib3-1.2.0/tests/ttanh.c Examining data/mpclib3-1.2.0/tests/tsub.c Examining data/mpclib3-1.2.0/tests/print_parameter.c Examining data/mpclib3-1.2.0/tests/tdiv_ui.c Examining data/mpclib3-1.2.0/tests/treimref.c Examining data/mpclib3-1.2.0/tests/close_datafile.c Examining data/mpclib3-1.2.0/tests/texp.c Examining data/mpclib3-1.2.0/tests/tacos.c Examining data/mpclib3-1.2.0/tests/read_description.c Examining data/mpclib3-1.2.0/tests/tpow_z.c Examining data/mpclib3-1.2.0/tests/trootofunity.c Examining data/mpclib3-1.2.0/tests/tpow_d.c Examining data/mpclib3-1.2.0/tests/tadd.c Examining data/mpclib3-1.2.0/tests/double_rounding.c Examining data/mpclib3-1.2.0/tests/read_data.c Examining data/mpclib3-1.2.0/tests/mpc-tests.h Examining data/mpclib3-1.2.0/tests/tcmp_abs.c Examining data/mpclib3-1.2.0/tests/tasin.c Examining data/mpclib3-1.2.0/tests/tcos.c Examining data/mpclib3-1.2.0/tests/tdiv_2ui.c Examining data/mpclib3-1.2.0/tests/tconj.c Examining data/mpclib3-1.2.0/tests/tfr_sub.c Examining data/mpclib3-1.2.0/tests/tui_ui_sub.c Examining data/mpclib3-1.2.0/tests/tdot.c Examining data/mpclib3-1.2.0/tests/tadd_ui.c Examining data/mpclib3-1.2.0/tests/tproj.c Examining data/mpclib3-1.2.0/tests/tdiv_fr.c Examining data/mpclib3-1.2.0/tests/tpl_mpc.c Examining data/mpclib3-1.2.0/tests/tneg.c Examining data/mpclib3-1.2.0/tests/open_datafile.c Examining data/mpclib3-1.2.0/tests/tadd_si.c Examining data/mpclib3-1.2.0/tests/tlog.c Examining data/mpclib3-1.2.0/tests/rounding.c Examining data/mpclib3-1.2.0/tests/mpfr_flags.c Examining data/mpclib3-1.2.0/tests/tacosh.c Examining data/mpclib3-1.2.0/tests/tsub_ui.c Examining data/mpclib3-1.2.0/tests/tsin_cos.c Examining data/mpclib3-1.2.0/tests/tadd_fr.c Examining data/mpclib3-1.2.0/tests/tatanh.c Examining data/mpclib3-1.2.0/tests/comparisons.c Examining data/mpclib3-1.2.0/tests/tprec.c Examining data/mpclib3-1.2.0/tests/tnorm.c Examining data/mpclib3-1.2.0/tests/read_line.c Examining data/mpclib3-1.2.0/tests/tsub_fr.c Examining data/mpclib3-1.2.0/tests/treal.c Examining data/mpclib3-1.2.0/tests/tmul_ui.c Examining data/mpclib3-1.2.0/tests/targ.c Examining data/mpclib3-1.2.0/tests/tstrtoc.c Examining data/mpclib3-1.2.0/tests/tatan.c Examining data/mpclib3-1.2.0/tests/tpow.c Examining data/mpclib3-1.2.0/tests/tmul_2ui.c Examining data/mpclib3-1.2.0/tests/tfma.c Examining data/mpclib3-1.2.0/tests/tlog10.c Examining data/mpclib3-1.2.0/tests/tcosh.c Examining data/mpclib3-1.2.0/tests/tpow_si.c Examining data/mpclib3-1.2.0/tests/tsinh.c Examining data/mpclib3-1.2.0/tests/random.c Examining data/mpclib3-1.2.0/tests/tdiv_2si.c Examining data/mpclib3-1.2.0/tests/tpl_mpfr.c Examining data/mpclib3-1.2.0/tests/tpl_gmp.c Examining data/mpclib3-1.2.0/tests/tsqrt.c Examining data/mpclib3-1.2.0/tests/tmul_i.c Examining data/mpclib3-1.2.0/tests/tmul_2si.c Examining data/mpclib3-1.2.0/tests/init_parameters.c Examining data/mpclib3-1.2.0/tests/tfr_div.c Examining data/mpclib3-1.2.0/tests/tsin.c Examining data/mpclib3-1.2.0/tests/tmul.c Examining data/mpclib3-1.2.0/src/real.c Examining data/mpclib3-1.2.0/src/arg.c Examining data/mpclib3-1.2.0/src/add_si.c Examining data/mpclib3-1.2.0/src/sin.c Examining data/mpclib3-1.2.0/src/uceil_log2.c Examining data/mpclib3-1.2.0/src/get_x.c Examining data/mpclib3-1.2.0/src/mul_fr.c Examining data/mpclib3-1.2.0/src/fr_div.c Examining data/mpclib3-1.2.0/src/pow_d.c Examining data/mpclib3-1.2.0/src/mpc-log.h Examining data/mpclib3-1.2.0/src/asinh.c Examining data/mpclib3-1.2.0/src/add_fr.c Examining data/mpclib3-1.2.0/src/set_prec.c Examining data/mpclib3-1.2.0/src/proj.c Examining data/mpclib3-1.2.0/src/out_str.c Examining data/mpclib3-1.2.0/src/dot.c Examining data/mpclib3-1.2.0/src/get_prec.c Examining data/mpclib3-1.2.0/src/sub_ui.c Examining data/mpclib3-1.2.0/src/rootofunity.c Examining data/mpclib3-1.2.0/src/ui_div.c Examining data/mpclib3-1.2.0/src/div.c Examining data/mpclib3-1.2.0/src/tan.c Examining data/mpclib3-1.2.0/src/fr_sub.c Examining data/mpclib3-1.2.0/src/set_x_x.c Examining data/mpclib3-1.2.0/src/sqr.c Examining data/mpclib3-1.2.0/src/add_ui.c Examining data/mpclib3-1.2.0/src/pow_fr.c Examining data/mpclib3-1.2.0/src/pow_ld.c Examining data/mpclib3-1.2.0/src/sqrt.c Examining data/mpclib3-1.2.0/src/logging.c Examining data/mpclib3-1.2.0/src/mpc-impl.h Examining data/mpclib3-1.2.0/src/init3.c Examining data/mpclib3-1.2.0/src/inp_str.c Examining data/mpclib3-1.2.0/src/tanh.c Examining data/mpclib3-1.2.0/src/div_2ui.c Examining data/mpclib3-1.2.0/src/norm.c Examining data/mpclib3-1.2.0/src/clear.c Examining data/mpclib3-1.2.0/src/init2.c Examining data/mpclib3-1.2.0/src/abs.c Examining data/mpclib3-1.2.0/src/sub_fr.c Examining data/mpclib3-1.2.0/src/set.c Examining data/mpclib3-1.2.0/src/cmp_abs.c Examining data/mpclib3-1.2.0/src/get_version.c Examining data/mpclib3-1.2.0/src/mul.c Examining data/mpclib3-1.2.0/src/mul_i.c Examining data/mpclib3-1.2.0/src/cmp.c Examining data/mpclib3-1.2.0/src/urandom.c Examining data/mpclib3-1.2.0/src/sum.c Examining data/mpclib3-1.2.0/src/get_prec2.c Examining data/mpclib3-1.2.0/src/acos.c Examining data/mpclib3-1.2.0/src/set_str.c Examining data/mpclib3-1.2.0/src/strtoc.c Examining data/mpclib3-1.2.0/src/ui_ui_sub.c Examining data/mpclib3-1.2.0/src/exp.c Examining data/mpclib3-1.2.0/src/pow.c Examining data/mpclib3-1.2.0/src/imag.c Examining data/mpclib3-1.2.0/src/cmp_si_si.c Examining data/mpclib3-1.2.0/src/atan.c Examining data/mpclib3-1.2.0/src/div_2si.c Examining data/mpclib3-1.2.0/src/pow_z.c Examining data/mpclib3-1.2.0/src/acosh.c Examining data/mpclib3-1.2.0/src/mul_2ui.c Examining data/mpclib3-1.2.0/src/sub.c Examining data/mpclib3-1.2.0/src/mul_si.c Examining data/mpclib3-1.2.0/src/asin.c Examining data/mpclib3-1.2.0/src/div_fr.c Examining data/mpclib3-1.2.0/src/sinh.c Examining data/mpclib3-1.2.0/src/div_ui.c Examining data/mpclib3-1.2.0/src/atanh.c Examining data/mpclib3-1.2.0/src/cosh.c Examining data/mpclib3-1.2.0/src/set_x.c Examining data/mpclib3-1.2.0/src/mem.c Examining data/mpclib3-1.2.0/src/cos.c Examining data/mpclib3-1.2.0/src/neg.c Examining data/mpclib3-1.2.0/src/swap.c Examining data/mpclib3-1.2.0/src/fma.c Examining data/mpclib3-1.2.0/src/log10.c Examining data/mpclib3-1.2.0/src/mpc.h Examining data/mpclib3-1.2.0/src/conj.c Examining data/mpclib3-1.2.0/src/log.c Examining data/mpclib3-1.2.0/src/mul_ui.c Examining data/mpclib3-1.2.0/src/pow_si.c Examining data/mpclib3-1.2.0/src/sin_cos.c Examining data/mpclib3-1.2.0/src/add.c Examining data/mpclib3-1.2.0/src/pow_ui.c Examining data/mpclib3-1.2.0/src/mul_2si.c FINAL RESULTS: data/mpclib3-1.2.0/src/get_x.c:94:7: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy (pretty, str); data/mpclib3-1.2.0/src/get_x.c:161:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (pretty, s); data/mpclib3-1.2.0/src/get_x.c:184:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (p, "%+"MPC_EXP_FORMAT_SPEC, x); data/mpclib3-1.2.0/src/get_x.c:227:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (complex_str, real_str); data/mpclib3-1.2.0/src/get_x.c:229:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat (complex_str, imag_str); data/mpclib3-1.2.0/src/inp_str.c:135:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ret = sprintf (str + lenstr, "(%s", suffix); data/mpclib3-1.2.0/src/inp_str.c:201:14: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ret = sprintf (str, "(%s %s", real_str, imag_str); data/mpclib3-1.2.0/src/logging.c:60:7: [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, "mpc_"#funcname" "#type); \ data/mpclib3-1.2.0/src/mpc-impl.h:129:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \ data/mpclib3-1.2.0/src/mpc-impl.h:137:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (#x "[%lu]=", (unsigned long int) mpfr_get_prec (x)); \ data/mpclib3-1.2.0/tests/mpc-tests.h:59:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (#x "[%lu,%lu]=", (unsigned long int) MPC_PREC_RE (x), \ data/mpclib3-1.2.0/tests/mpc-tests.h:67:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf (#x "[%lu]=", (unsigned long int) mpfr_get_prec (x)); \ data/mpclib3-1.2.0/tests/open_datafile.c:46:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (datafile_context->pathname, "%s/%s", src_dir, data_filename); data/mpclib3-1.2.0/tests/read_data.c:61:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (pathname, "%s/%s", src_dir, file_name); data/mpclib3-1.2.0/tests/open_datafile.c:35: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. src_dir = getenv ("srcdir"); data/mpclib3-1.2.0/tests/random.c:60:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. environment_seed = getenv ("GMP_CHECK_RANDOMIZE"); data/mpclib3-1.2.0/tests/read_data.c:51: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. src_dir = getenv ("srcdir"); data/mpclib3-1.2.0/tests/open_datafile.c:47:26: [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). datafile_context->fd = fopen (datafile_context->pathname, "r"); data/mpclib3-1.2.0/tests/random.c:65:34: [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). seed = (unsigned long int) atoi (environment_seed); data/mpclib3-1.2.0/tests/read_data.c:62: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). fp = fopen (pathname, "r"); data/mpclib3-1.2.0/tests/tio_str.c:122:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(fp = fopen (tmp_file, "w"))) data/mpclib3-1.2.0/tests/tio_str.c:131:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(fp = fopen (tmp_file, "r"))) data/mpclib3-1.2.0/tests/tpow_ui.c:98:11: [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). p = atoi (argv[1]); data/mpclib3-1.2.0/tests/tpow_ui.c:99:11: [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). n = atoi (argv[2]); data/mpclib3-1.2.0/tests/tpow_ui.c:101:24: [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). k = (argc > 3) ? atoi (argv[3]) : 1; data/mpclib3-1.2.0/tools/mpcheck/mpcheck-double.c:154:15: [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). p = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-double.c:160:18: [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). seed = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-double.c:166:15: [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). n = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float.c:159:15: [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). p = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float.c:165:18: [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). seed = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float.c:171:15: [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). n = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float128.c:164:15: [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). p = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float128.c:170:18: [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). seed = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-float128.c:176:15: [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). n = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-longdouble.c:147:15: [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). p = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-longdouble.c:153:18: [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). seed = atoi (argv[2]); data/mpclib3-1.2.0/tools/mpcheck/mpcheck-longdouble.c:159:15: [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). n = atoi (argv[2]); data/mpclib3-1.2.0/src/get_x.c:88: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 (str) + 1; /* + terminal '\0' */ data/mpclib3-1.2.0/src/get_x.c:167: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). p = pretty + strlen (str) + 1; data/mpclib3-1.2.0/src/get_x.c:221: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). needed_size = strlen (real_str) + strlen (imag_str) + 4; data/mpclib3-1.2.0/src/get_x.c:221: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). needed_size = strlen (real_str) + strlen (imag_str) + 4; data/mpclib3-1.2.0/src/get_x.c:226:3: [1] (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). Risk is low because the source is a constant character. strcpy (complex_str, "("); data/mpclib3-1.2.0/src/get_x.c:228:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat (complex_str, " "); data/mpclib3-1.2.0/src/get_x.c:230:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat (complex_str, ")"); data/mpclib3-1.2.0/src/inp_str.c:29:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:32:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:51:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:59:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:85:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:95:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:128: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). nread += strlen (suffix) + 1; data/mpclib3-1.2.0/src/inp_str.c:140:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:161:49: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). mpc_inp_str (mpc_ptr rop, FILE *stream, size_t *read, int base, data/mpclib3-1.2.0/src/inp_str.c:173:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:184: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). nread += strlen(real_str); data/mpclib3-1.2.0/src/inp_str.c:186:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:198: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). nread += strlen (imag_str); data/mpclib3-1.2.0/src/inp_str.c:209:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc (stream); data/mpclib3-1.2.0/src/inp_str.c:223:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nread += strlen (str); data/mpclib3-1.2.0/src/inp_str.c:236:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read != NULL) data/mpclib3-1.2.0/src/mem.c:45: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). (*freefunc) (str, strlen (str) + 1); data/mpclib3-1.2.0/tests/open_datafile.c:40: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). (char *) malloc ((strlen (src_dir)) + strlen (data_filename) + 2); data/mpclib3-1.2.0/tests/open_datafile.c:40:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (char *) malloc ((strlen (src_dir)) + strlen (data_filename) + 2); data/mpclib3-1.2.0/tests/open_datafile.c:55:32: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/read_data.c:55: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). pathname = (char *) malloc ((strlen (src_dir)) + strlen (file_name) + 2); data/mpclib3-1.2.0/tests/read_data.c:55:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pathname = (char *) malloc ((strlen (src_dir)) + strlen (file_name) + 2); data/mpclib3-1.2.0/tests/read_data.c:86:17: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:90:19: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:103:19: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:129:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:148:18: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:166:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:208:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:235:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:274:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:299:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_data.c:320:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/read_description.c:93:36: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/read_description.c:253: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). if (strlen (buffer) == 0 && feof (datafile_context.fd)) data/mpclib3-1.2.0/tests/read_line.c:183:35: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/read_line.c:187:37: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/read_line.c:200:37: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/read_line.c:247:32: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tio_str.c:60:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/tio_str.c:80:20: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/tio_str.c:104:26: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((nextchar = getc (fp)) != '"'); data/mpclib3-1.2.0/tests/tio_str.c:105:18: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); data/mpclib3-1.2.0/tests/tpl_gmp.c:39:33: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tpl_mpfr.c:44:33: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tpl_mpfr.c:65:33: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tpl_mpfr.c:111:34: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tpl_native.c:46:32: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tpl_native.c:78:32: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tpl_native.c:111:32: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datafile_context->nextchar = getc (datafile_context->fd); data/mpclib3-1.2.0/tests/tstrtoc.c:74:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nextchar = getc (fp); ANALYSIS SUMMARY: Hits = 95 Lines analyzed = 19908 in approximately 0.62 seconds (31861 lines/second) Physical Source Lines of Code (SLOC) = 12310 Hits@level = [0] 361 [1] 58 [2] 20 [3] 3 [4] 14 [5] 0 Hits@level+ = [0+] 456 [1+] 95 [2+] 37 [3+] 17 [4+] 14 [5+] 0 Hits/KSLOC@level+ = [0+] 37.0431 [1+] 7.7173 [2+] 3.00569 [3+] 1.38099 [4+] 1.13729 [5+] 0 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.