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/mpsolve-3.2.1/examples/C/secular.c Examining data/mpsolve-3.2.1/examples/C/root_of_unity.c Examining data/mpsolve-3.2.1/examples/C/dummy.cpp Examining data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-evaluation.c Examining data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-newton.c Examining data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-poly.c Examining data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-poly.h Examining data/mpsolve-3.2.1/examples/quadratic-solver/dummy.cpp Examining data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-starting.c Examining data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-solver.c Examining data/mpsolve-3.2.1/examples/gtk/roots_of_unity.c Examining data/mpsolve-3.2.1/examples/fortran/mps_impl.c Examining data/mpsolve-3.2.1/examples/matlab/mps_roots_double.c Examining data/mpsolve-3.2.1/examples/matlab/mps_roots_string.c Examining data/mpsolve-3.2.1/examples/matlab/mps_option_parser.c Examining data/mpsolve-3.2.1/examples/matlab/mps_option_parser.h Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-solver.c Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-poly.c Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-evaluation.c Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-newton.c Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/dummy.cpp Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-poly.h Examining data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-starting.c Examining data/mpsolve-3.2.1/examples/octave/octave_support.cpp Examining data/mpsolve-3.2.1/examples/octave/mps_det.cc Examining data/mpsolve-3.2.1/examples/octave/mps_polyeig_impl.cc Examining data/mpsolve-3.2.1/examples/octave/mps_regenerate.cc Examining data/mpsolve-3.2.1/examples/octave/mps_secular.cc Examining data/mpsolve-3.2.1/examples/octave/mps_roots.cc Examining data/mpsolve-3.2.1/include/mps/parser.h Examining data/mpsolve-3.2.1/include/mps/regeneration-driver.h Examining data/mpsolve-3.2.1/include/mps/matrix.h Examining data/mpsolve-3.2.1/include/mps/mps.h Examining data/mpsolve-3.2.1/include/mps/approximation.h Examining data/mpsolve-3.2.1/include/mps/mt.h Examining data/mpsolve-3.2.1/include/mps/types.h Examining data/mpsolve-3.2.1/include/mps/debug.h Examining data/mpsolve-3.2.1/include/mps/monomial-poly.h Examining data/mpsolve-3.2.1/include/mps/mt-types.h Examining data/mpsolve-3.2.1/include/mps/context.h Examining data/mpsolve-3.2.1/include/mps/private/touch.h Examining data/mpsolve-3.2.1/include/mps/private/input-output.h Examining data/mpsolve-3.2.1/include/mps/private/cluster.h Examining data/mpsolve-3.2.1/include/mps/private/secular-evaluation.h Examining data/mpsolve-3.2.1/include/mps/private/improve.h Examining data/mpsolve-3.2.1/include/mps/private/newton.h Examining data/mpsolve-3.2.1/include/mps/private/secular-regeneration.h Examining data/mpsolve-3.2.1/include/mps/private/hessenberg-determinant.h Examining data/mpsolve-3.2.1/include/mps/private/horner.h Examining data/mpsolve-3.2.1/include/mps/private/aberth.h Examining data/mpsolve-3.2.1/include/mps/private/system/memory-file-stream.h Examining data/mpsolve-3.2.1/include/mps/private/system/abstract-input-stream.h Examining data/mpsolve-3.2.1/include/mps/private/system/file-input-stream.h Examining data/mpsolve-3.2.1/include/mps/private/starting-configuration.h Examining data/mpsolve-3.2.1/include/mps/private/threading.h Examining data/mpsolve-3.2.1/include/mps/private/tools.h Examining data/mpsolve-3.2.1/include/mps/private/data.h Examining data/mpsolve-3.2.1/include/mps/private/formal/formal-polynomial.h Examining data/mpsolve-3.2.1/include/mps/private/formal/formal-monomial.h Examining data/mpsolve-3.2.1/include/mps/private/algorithms.h Examining data/mpsolve-3.2.1/include/mps/private/utils.h Examining data/mpsolve-3.2.1/include/mps/private/convex.h Examining data/mpsolve-3.2.1/include/mps/private/list.h Examining data/mpsolve-3.2.1/include/mps/private/solve.h Examining data/mpsolve-3.2.1/include/mps/private/starting.h Examining data/mpsolve-3.2.1/include/mps/private/sort.h Examining data/mpsolve-3.2.1/include/mps/private/radii.h Examining data/mpsolve-3.2.1/include/mps/private/jacobi-aberth.h Examining data/mpsolve-3.2.1/include/mps/private/input-buffer.h Examining data/mpsolve-3.2.1/include/mps/private/mandelbrot-user.h Examining data/mpsolve-3.2.1/include/mps/private/options.h Examining data/mpsolve-3.2.1/include/mps/secular-equation.h Examining data/mpsolve-3.2.1/include/mps/nroots-polynomial.h Examining data/mpsolve-3.2.1/include/mps/version.h Examining data/mpsolve-3.2.1/include/mps/polynomial.h Examining data/mpsolve-3.2.1/include/mps/chebyshev.h Examining data/mpsolve-3.2.1/include/mps/mpc.h Examining data/mpsolve-3.2.1/include/mps/monomial-matrix-poly.h Examining data/mpsolve-3.2.1/include/mps/gmptools.h Examining data/mpsolve-3.2.1/include/mps/link.h Examining data/mpsolve-3.2.1/include/mps/interface.h Examining data/mpsolve-3.2.1/src/libmps/general/general-starting.c Examining data/mpsolve-3.2.1/src/libmps/general/general-radius.c Examining data/mpsolve-3.2.1/src/libmps/secsolve/secular-ga.c Examining data/mpsolve-3.2.1/src/libmps/secsolve/secular-regeneration.c Examining data/mpsolve-3.2.1/src/libmps/secsolve/standard-regeneration-driver.c Examining data/mpsolve-3.2.1/src/libmps/secsolve/secular-iteration.c Examining data/mpsolve-3.2.1/src/libmps/common/defaults.c Examining data/mpsolve-3.2.1/src/libmps/common/nroots-polynomial.cpp Examining data/mpsolve-3.2.1/src/libmps/common/utils.c Examining data/mpsolve-3.2.1/src/libmps/common/sort.c Examining data/mpsolve-3.2.1/src/libmps/common/convex.c Examining data/mpsolve-3.2.1/src/libmps/common/touch.c Examining data/mpsolve-3.2.1/src/libmps/common/list.c Examining data/mpsolve-3.2.1/src/libmps/common/file-starting.c Examining data/mpsolve-3.2.1/src/libmps/common/parser.c Examining data/mpsolve-3.2.1/src/libmps/common/list-element.c Examining data/mpsolve-3.2.1/src/libmps/common/inclusion.c Examining data/mpsolve-3.2.1/src/libmps/common/improve.c Examining data/mpsolve-3.2.1/src/libmps/common/approximation.c Examining data/mpsolve-3.2.1/src/libmps/common/validation.c Examining data/mpsolve-3.2.1/src/libmps/common/polynomial.c Examining data/mpsolve-3.2.1/src/libmps/common/modify.c Examining data/mpsolve-3.2.1/src/libmps/common/jacobi-aberth.c Examining data/mpsolve-3.2.1/src/libmps/common/cluster-analysis.c Examining data/mpsolve-3.2.1/src/libmps/common/polynomialxx.cpp Examining data/mpsolve-3.2.1/src/libmps/common/tools.c Examining data/mpsolve-3.2.1/src/libmps/common/recursive-starting.c Examining data/mpsolve-3.2.1/src/libmps/common/interface.c Examining data/mpsolve-3.2.1/src/libmps/common/context.c Examining data/mpsolve-3.2.1/src/libmps/common/strndup.c Examining data/mpsolve-3.2.1/src/libmps/common/test.c Examining data/mpsolve-3.2.1/src/libmps/common/version.c Examining data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c Examining data/mpsolve-3.2.1/src/libmps/common/cluster.c Examining data/mpsolve-3.2.1/src/libmps/common/aberth.c Examining data/mpsolve-3.2.1/src/libmps/common/starting-configuration.c Examining data/mpsolve-3.2.1/src/libmps/common/user.c Examining data/mpsolve-3.2.1/src/libmps/common/starting.c Examining data/mpsolve-3.2.1/src/libmps/monomial/monomial-matrix-poly.c Examining data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.h Examining data/mpsolve-3.2.1/src/libmps/monomial/monomial-poly.c Examining data/mpsolve-3.2.1/src/libmps/monomial/monomial-threading.c Examining data/mpsolve-3.2.1/src/libmps/monomial/monomial-parser.c Examining data/mpsolve-3.2.1/src/libmps/monomial/shift.c Examining data/mpsolve-3.2.1/src/libmps/monomial/newton.c Examining data/mpsolve-3.2.1/src/libmps/monomial/tokenizer.c Examining data/mpsolve-3.2.1/src/libmps/monomial/horner.c Examining data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c Examining data/mpsolve-3.2.1/src/libmps/unisolve/solve.c Examining data/mpsolve-3.2.1/src/libmps/unisolve/main.c Examining data/mpsolve-3.2.1/src/libmps/matrix/hessenberg-determinant.c Examining data/mpsolve-3.2.1/src/libmps/system/debug.c Examining data/mpsolve-3.2.1/src/libmps/system/input-output.c Examining data/mpsolve-3.2.1/src/libmps/system/file-input-stream.cpp Examining data/mpsolve-3.2.1/src/libmps/system/getopts.c Examining data/mpsolve-3.2.1/src/libmps/system/input-buffer.c Examining data/mpsolve-3.2.1/src/libmps/system/threading.c Examining data/mpsolve-3.2.1/src/libmps/system/getline.c Examining data/mpsolve-3.2.1/src/libmps/system/abstract-input-stream.cpp Examining data/mpsolve-3.2.1/src/libmps/system/memory-file-stream.cpp Examining data/mpsolve-3.2.1/src/libmps/system/data.c Examining data/mpsolve-3.2.1/src/libmps/formal/formal-polynomial.cpp Examining data/mpsolve-3.2.1/src/libmps/formal/formal-monomial.cpp Examining data/mpsolve-3.2.1/src/libmps/secular/secular-evaluation.c Examining data/mpsolve-3.2.1/src/libmps/secular/secular-starting.c Examining data/mpsolve-3.2.1/src/libmps/secular/secular-parser.c Examining data/mpsolve-3.2.1/src/libmps/secular/secular-newton.c Examining data/mpsolve-3.2.1/src/libmps/secular/secular-equation.c Examining data/mpsolve-3.2.1/src/libmps/chebyshev/chebyshev-parser.c Examining data/mpsolve-3.2.1/src/libmps/chebyshev/chebyshev-evaluation.c Examining data/mpsolve-3.2.1/src/libmps/chebyshev/chebyshev.c Examining data/mpsolve-3.2.1/src/libmps/floating-point/link.c Examining data/mpsolve-3.2.1/src/libmps/floating-point/gmptools.c Examining data/mpsolve-3.2.1/src/libmps/floating-point/mt.c Examining data/mpsolve-3.2.1/src/libmps/floating-point/mpc.c Examining data/mpsolve-3.2.1/src/tests/check_matrix.c Examining data/mpsolve-3.2.1/src/tests/check_implementation.h Examining data/mpsolve-3.2.1/src/tests/check_utils.c Examining data/mpsolve-3.2.1/src/tests/check_multithread.c Examining data/mpsolve-3.2.1/src/tests/check_implementation.c Examining data/mpsolve-3.2.1/src/tests/check_parser.c Examining data/mpsolve-3.2.1/src/tests/check_list.c Examining data/mpsolve-3.2.1/src/tests/check_version.c Examining data/mpsolve-3.2.1/src/tests/check_dpe.c Examining data/mpsolve-3.2.1/src/tests/check_mpc.c Examining data/mpsolve-3.2.1/src/tests/check_context.c Examining data/mpsolve-3.2.1/src/tests/check_secsolve.c Examining data/mpsolve-3.2.1/src/tests/check_unisolve.c Examining data/mpsolve-3.2.1/src/tests/check_formal.cpp Examining data/mpsolve-3.2.1/src/tests/check_cluster.c Examining data/mpsolve-3.2.1/src/tests/check_chebyshev.c Examining data/mpsolve-3.2.1/src/tests/check_monomial_poly.c Examining data/mpsolve-3.2.1/src/tests/check_convex.c Examining data/mpsolve-3.2.1/src/tests/dummy.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/rootsrenderer.h Examining data/mpsolve-3.2.1/src/xmpsolve/polfileeditor.h Examining data/mpsolve-3.2.1/src/xmpsolve/polsyntaxhighlighter.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/rootsrenderer.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/monomial.h Examining data/mpsolve-3.2.1/src/xmpsolve/root.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/rootsmodel.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/mpsolveworker.h Examining data/mpsolve-3.2.1/src/xmpsolve/rootsmodel.h Examining data/mpsolve-3.2.1/src/xmpsolve/qrootsrenderer.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/qrootsrenderer.h Examining data/mpsolve-3.2.1/src/xmpsolve/polynomialsolver.h Examining data/mpsolve-3.2.1/src/xmpsolve/mainwindow.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/qquickrootsrenderer.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/root.h Examining data/mpsolve-3.2.1/src/xmpsolve/mainwindow.h Examining data/mpsolve-3.2.1/src/xmpsolve/polsyntaxhighlighter.h Examining data/mpsolve-3.2.1/src/xmpsolve/polfileeditorwindow.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/main.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/qquickrootsrenderer.h Examining data/mpsolve-3.2.1/src/xmpsolve/mpsolveworker.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/mainqmlview.h Examining data/mpsolve-3.2.1/src/xmpsolve/mainqmlview.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/polynomialsolver.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/polfileeditor.cpp Examining data/mpsolve-3.2.1/src/xmpsolve/polfileeditorwindow.h Examining data/mpsolve-3.2.1/src/mpsolve/iteration-logger.h Examining data/mpsolve-3.2.1/src/mpsolve/iteration-logger.c Examining data/mpsolve-3.2.1/src/mpsolve/mpsolve.c FINAL RESULTS: data/mpsolve-3.2.1/examples/matlab/mps_option_parser.c:106:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffer, "The property '%s' is invalid\n", optionName); data/mpsolve-3.2.1/include/mps/debug.h:165:11: [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 (s->logstr, function); fprintf (s->logstr, "()\033[0m\n"); \ data/mpsolve-3.2.1/include/mps/debug.h:169:11: [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 (s->logstr, function); fprintf (s->logstr, "()\n"); \ data/mpsolve-3.2.1/include/mps/debug.h:181:11: [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 (s->logstr, function); fprintf (s->logstr, "()\033[0m\n"); \ data/mpsolve-3.2.1/include/mps/debug.h:185:11: [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 (s->logstr, function); fprintf (s->logstr, "()\n"); \ data/mpsolve-3.2.1/include/mps/debug.h:207: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 (s->logstr, templ); \ data/mpsolve-3.2.1/include/mps/debug.h:219: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 (s->logstr, templ); \ data/mpsolve-3.2.1/src/libmps/common/parser.c:45:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (output, "Parsing error on line %ld near the token: %s", buffer->line_number, token); data/mpsolve-3.2.1/src/libmps/common/parser.c:193: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 (option, c_ptr); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:102:10: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. return sscanf (s, CPLX_INP_FMT, &cplx_Re (x), &cplx_Im (x)) == 2; data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:119:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (s, CPLX_OUT_FMT, cplx_Re (x), cplx_Im (x)); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:558:10: [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. return fprintf (f, CPLX_OUT_UFMT, cplx_Re (x), cplx_Im (x)); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:567:10: [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. return fprintf (f, CPLX_OUT_FMT, cplx_Re (x), cplx_Im (x)); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:578:13: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. int ret = fscanf (f, CPLX_INP_UFMT, &real, &imag); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:591:13: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. int ret = fscanf (f, CPLX_INP_FMT, &real, &imag); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:697:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (s, RDPE_INP_FMT, &rdpe_Mnt (e), &rdpe_Esp (e)) != 2) data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:752:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (s, RDPE_OUT_FMT, d, l); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1541:10: [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. return fprintf (f, RDPE_OUT_UFMT, d, l); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1554:10: [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. return fprintf (f, RDPE_OUT_FMT, d, l); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1566:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (fscanf (f, RDPE_INP_UFMT, &d, &l) != 2) data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1581:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (fscanf (f, RDPE_INP_FMT, &d, &l) != 2) data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1597:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (fscanf (f, RDPE_INP_FMT, &d, &l) < 1) data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1610:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf (f, RDPE_INP_FMT, &d, &l) < 1) data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1791:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:1836:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (s, CDPE_OUT_FMT, dr, lr, di, li); data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:2370:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (fscanf (f, CDPE_INP_UFMT, &dr, &lr, &di, &li) != 4) data/mpsolve-3.2.1/src/libmps/floating-point/mt.c:2386:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (fscanf (f, CDPE_INP_FMT, &dr, &lr, &di, &li) != 4) data/mpsolve-3.2.1/src/libmps/formal/formal-monomial.cpp:69:5: [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(buf, output.str().c_str()); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:623: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/mpsolve-3.2.1/src/libmps/system/debug.c:104: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 (ctx->logstr, format, ap); data/mpsolve-3.2.1/src/libmps/system/debug.c:121: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 (ctx->logstr, format, ap); data/mpsolve-3.2.1/src/libmps/system/input-output.c:579:11: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, format, ap); data/mpsolve-3.2.1/src/libmps/system/input-output.c:584:11: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, format, ap); data/mpsolve-3.2.1/src/libmps/system/input-output.c:610:9: [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. #ifndef vsnprintf data/mpsolve-3.2.1/src/libmps/system/input-output.c:612: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. int snprintf (char *str, size_t size, const char *format, ...); data/mpsolve-3.2.1/src/libmps/system/input-output.c:637:32: [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. while ((missing_characters = vsnprintf (s->last_error, buffer_size, format, ap)) > buffer_size) data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:296:11: [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 (PACKAGE_STRING "\n"); data/mpsolve-3.2.1/src/tests/check_implementation.c:107: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 (final_path, srcdir_path); data/mpsolve-3.2.1/src/tests/check_implementation.c:109: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 (final_path, type_name); data/mpsolve-3.2.1/src/tests/check_implementation.c:111: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 (final_path, pol_name); data/mpsolve-3.2.1/src/tests/check_implementation.c:141: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 (final_path, srcdir_path); data/mpsolve-3.2.1/src/tests/check_implementation.c:147: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 (final_path, type_name); data/mpsolve-3.2.1/src/tests/check_implementation.c:149: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 (final_path, pol_name); data/mpsolve-3.2.1/src/xmpsolve/rootsrenderer.cpp:117:14: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. text.sprintf("%1.2e", tick_distance * i); data/mpsolve-3.2.1/src/xmpsolve/rootsrenderer.cpp:130:14: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. text.sprintf("%1.2e", tick_distance * i); data/mpsolve-3.2.1/src/libmps/common/tools.c:44:3: [3] (random) srand: 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. srand (seed); data/mpsolve-3.2.1/src/libmps/system/threading.c:58:20: [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 ((cores_env = getenv ("MPS_JOBS")) != NULL) data/mpsolve-3.2.1/src/tests/check_chebyshev.c:163: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 ("MPS_SIMPLE_TESTS_ONLY") != NULL) data/mpsolve-3.2.1/src/tests/check_implementation.c:91: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. char *srcdir_path = getenv ("srcdir"); data/mpsolve-3.2.1/src/tests/check_implementation.c:125: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. char *srcdir_path = getenv ("srcdir"); data/mpsolve-3.2.1/src/tests/check_secsolve.c:62:8: [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 ("MPS_VERBOSE_TEST") && strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST"))) || pol->DOLOG) data/mpsolve-3.2.1/src/tests/check_secsolve.c:62:62: [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 ("MPS_VERBOSE_TEST") && strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST"))) || pol->DOLOG) data/mpsolve-3.2.1/src/tests/check_secsolve.c:119:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_secsolve.c:119:66: [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 ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_secsolve.c:150: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. if (getenv ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_secsolve.c:150:70: [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 ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_secsolve.c:167:8: [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 ("MPS_VERBOSE_TEST") && strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST"))) || pol->DOLOG) data/mpsolve-3.2.1/src/tests/check_secsolve.c:167:62: [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 ("MPS_VERBOSE_TEST") && strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST"))) || pol->DOLOG) data/mpsolve-3.2.1/src/tests/check_secsolve.c:190: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 ("MPS_VERBOSE_TEST")) data/mpsolve-3.2.1/src/tests/check_secsolve.c:658: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 ("MPS_SIMPLE_TESTS_ONLY") != NULL) data/mpsolve-3.2.1/src/tests/check_unisolve.c:60: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 ("MPS_VERBOSE_TEST") && strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST"))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:60:61: [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 ("MPS_VERBOSE_TEST") && strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST"))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:116:11: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:116:66: [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 ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:147: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. if (getenv ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:147:70: [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 ("MPS_VERBOSE_TEST") && (strstr (pol->pol_file, getenv ("MPS_VERBOSE_TEST")))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:181: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 ("MPS_VERBOSE_TEST")) data/mpsolve-3.2.1/src/tests/check_unisolve.c:227: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 ("MPS_SIMPLE_TESTS_ONLY") != NULL) data/mpsolve-3.2.1/examples/C/root_of_unity.c:42: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[1]); data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-solver.c:25: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). int n = atoi (argv[1]); data/mpsolve-3.2.1/examples/mandelbrot-solver/mandelbrot-starting.c:98:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE * input = fopen (starting_file, "r"); data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-solver.c:25: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). int n = atoi (argv[1]); data/mpsolve-3.2.1/examples/quadratic-solver/quadratic-starting.c:98:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE * input = fopen (starting_file, "r"); data/mpsolve-3.2.1/src/libmps/common/parser.c:215:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE * handle = fopen (path, "r"); data/mpsolve-3.2.1/src/libmps/common/parser.c:305:22: [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). s->n = atoi (input_option.value); data/mpsolve-3.2.1/src/libmps/common/parser.c:317:33: [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). input_precision = atoi (input_option.value) * LOG2_10; data/mpsolve-3.2.1/src/libmps/common/tools.c:33:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). rf = fopen (RAND_SOURCE, "rb"); data/mpsolve-3.2.1/src/libmps/monomial/monomial-parser.c:261: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 data_type[3]; data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:871: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/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1064: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/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1342: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). int exp = atoi(coeffStr); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1371:47: [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. printf ("Simple monomial: %s\n", (const char *) (yyvsp[0])); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1374:40: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char * exp = strchr ((const char *) (yyvsp[0]), '^'); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1375:40: [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). long degree = (exp == NULL) ? 1 : atoi (exp + 1); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1408:51: [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. printf ("Rational coefficient: %s\n", (const char *) (yyvsp[0])); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1420:57: [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. printf ("Floating point coefficient: %s\n", (const char *) (yyvsp[0])); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:1422:76: [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. mps_formal_monomial * m = mps_formal_monomial_new_with_string ((const char *) (yyvsp[0]), 0); data/mpsolve-3.2.1/src/libmps/system/threading.c:61:43: [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). cores = MAX (1, MIN (MPS_MAX_CORES, atoi (cores_env))); data/mpsolve-3.2.1/src/mpsolve/iteration-logger.c:178: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 str_buf[1023]; data/mpsolve-3.2.1/src/mpsolve/iteration-logger.c:193:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (str_buf, "%1.2e", center + k * sep); data/mpsolve-3.2.1/src/mpsolve/iteration-logger.c:218: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 str_buf[1023]; data/mpsolve-3.2.1/src/mpsolve/iteration-logger.c:233:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (str_buf, "%1.2e", center + k * sep); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:286:28: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* logstr = fopen (opt->optvalue, "w"); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:437:24: [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). s->rtstr = fopen (opt->optvalue, "r"); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:484:44: [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). mps_context_set_output_prec (s, (atoi (opt->optvalue)) * LOG2_10 + 1); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:487:29: [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). input_precision = atoi (opt->optvalue) * LOG2_10; data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:521:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char output[255]; data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:555:19: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (output, "Unrecognized debug option: %c", *(opt->optvalue - 1)); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:577:19: [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). s->rtstr = fopen (opt->optvalue, "r"); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:605:59: [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). mps_thread_pool_set_concurrency_limit (s, NULL, atoi (opt->optvalue)); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:606:26: [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). s->n_threads = atoi (opt->optvalue); data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:660: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). infile = fopen (argv[1], "r"); data/mpsolve-3.2.1/src/tests/check_implementation.c:16: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 set_timeout_string[255]; data/mpsolve-3.2.1/src/tests/check_implementation.c:18:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (set_timeout_string, "CK_DEFAULT_TIMEOUT=%d", timeout); data/mpsolve-3.2.1/src/tests/check_implementation.c:112:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat (final_path, ".pol"); data/mpsolve-3.2.1/src/tests/check_implementation.c:143:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat (final_path, ".."); data/mpsolve-3.2.1/src/tests/check_implementation.c:145:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat (final_path, "results"); data/mpsolve-3.2.1/src/tests/check_implementation.c:150:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat (final_path, ".res"); data/mpsolve-3.2.1/src/tests/check_secsolve.c:43:25: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* result_stream = fopen (pol->res_file, "r"); data/mpsolve-3.2.1/src/tests/check_secsolve.c:44:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* input_stream = fopen (pol->pol_file, "r"); data/mpsolve-3.2.1/src/tests/check_unisolve.c:41:25: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* result_stream = fopen (pol->res_file, "r"); data/mpsolve-3.2.1/src/tests/check_unisolve.c:42:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* input_stream = fopen (pol->pol_file, "r"); data/mpsolve-3.2.1/src/tests/check_version.c:7: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[255]; data/mpsolve-3.2.1/src/tests/check_version.c:11:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "%u.%u.%u", mps_get_major_version(), data/mpsolve-3.2.1/src/tests/check_version.c:16:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "%u.%u.%u", MPS_MAJOR_VERSION, data/mpsolve-3.2.1/src/xmpsolve/polfileeditor.cpp:23:21: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (polFile.open(QIODevice::ReadOnly)) { data/mpsolve-3.2.1/src/xmpsolve/polfileeditor.cpp:53:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (outFile.open(QIODevice::WriteOnly)) { data/mpsolve-3.2.1/examples/matlab/mps_option_parser.c:105:59: [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 * buffer = (char*) mxMalloc (sizeof (char) * (strlen ("The property '' is invalid\n") + strlen ((char*) optionName) + 1)); data/mpsolve-3.2.1/examples/matlab/mps_option_parser.c:105:101: [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 * buffer = (char*) mxMalloc (sizeof (char) * (strlen ("The property '' is invalid\n") + strlen ((char*) optionName) + 1)); data/mpsolve-3.2.1/include/mps/private/system/abstract-input-stream.h:87:17: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual int getchar () = 0; data/mpsolve-3.2.1/include/mps/private/system/file-input-stream.h:92:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int getchar (); data/mpsolve-3.2.1/include/mps/private/system/memory-file-stream.h:100:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int getchar (); data/mpsolve-3.2.1/src/libmps/common/file-starting.c:49:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((next = fgetc (input)) != '\n') data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:58:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (copy, exponent_start, ptr - exponent_start); data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:82: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). char * copy = mps_newv (char, 2 * strlen (orig_line) + 5); data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:85:38: [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 * line_end = allocated_line + strlen (orig_line); data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:106: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). line_end = line_ptr + strlen (line); data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:165: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). for (copy_ptr = copy; copy_ptr < copy + strlen (copy); copy_ptr++) data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:176: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). while ((copy_ptr < copy + strlen(copy) - 1) && data/mpsolve-3.2.1/src/libmps/common/inline-poly-parser.c:185: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). for (i = 0; i < strlen(copy) - shift + 1; i++) data/mpsolve-3.2.1/src/libmps/common/parser.c:25:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((buf = fgetc (input_stream)) == '!' || isspace (buf)) data/mpsolve-3.2.1/src/libmps/common/parser.c:28:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (fgetc (input_stream) != '\n') data/mpsolve-3.2.1/src/libmps/common/parser.c:44:54: [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 * output = (char*)mps_malloc (sizeof(char) * (strlen (token) + 256)); data/mpsolve-3.2.1/src/libmps/common/parser.c:192: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). option = (char*)mps_malloc (sizeof(char) * (strlen (option) + 1)); data/mpsolve-3.2.1/src/libmps/common/parser.c:294: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). mps_parse_option_line (s, line, strlen (line)); data/mpsolve-3.2.1/src/libmps/common/strndup.c:24: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 length = strlen (source); data/mpsolve-3.2.1/src/libmps/common/utils.c:35: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). end = start + strlen (start) - 1; data/mpsolve-3.2.1/src/libmps/common/utils.c:80: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). size_t length = strlen (equivalent_rational_string); data/mpsolve-3.2.1/src/libmps/common/utils.c:94: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). size_t length = strlen (equivalent_rational_string); data/mpsolve-3.2.1/src/libmps/common/utils.c:118: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). size_t length = strlen (equivalent_rational_string); data/mpsolve-3.2.1/src/libmps/common/utils.c:126:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char * ptr = equivalent_rational_string + strlen (equivalent_rational_string); data/mpsolve-3.2.1/src/libmps/monomial/monomial-parser.c:276:18: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (!token || !sscanf (token, "%3s", data_type)) data/mpsolve-3.2.1/src/libmps/monomial/tokenizer.c:794: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/mpsolve-3.2.1/src/libmps/monomial/tokenizer.c:1920: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) , yyscanner); data/mpsolve-3.2.1/src/libmps/monomial/yacc-parser.c:771: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/mpsolve-3.2.1/src/libmps/system/abstract-input-stream.cpp:31:61: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return reinterpret_cast<AbstractInputStream*> (stream)->getchar(); data/mpsolve-3.2.1/src/libmps/system/file-input-stream.cpp:47:18: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). FileInputStream::getchar () data/mpsolve-3.2.1/src/libmps/system/file-input-stream.cpp:49:10: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return fgetc (mSource); data/mpsolve-3.2.1/src/libmps/system/getline.c:86:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = getc (fp); data/mpsolve-3.2.1/src/libmps/system/getopts.c:59: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). int i, l = strlen (opt_format), steps; data/mpsolve-3.2.1/src/libmps/system/input-buffer.c:105: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). length = strlen (buf->line); data/mpsolve-3.2.1/src/libmps/system/input-buffer.c:192:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ret, buf->last_token, token_size); data/mpsolve-3.2.1/src/libmps/system/input-output.c:576:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (format[strlen (format)] == '\n') data/mpsolve-3.2.1/src/libmps/system/input-output.c:657: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 length = strlen (error); data/mpsolve-3.2.1/src/libmps/system/memory-file-stream.cpp:63: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). return (mInputStream.fail()) ? -1 : strlen (*buffer) + 1; data/mpsolve-3.2.1/src/libmps/system/memory-file-stream.cpp:73:19: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). MemoryFileStream::getchar() data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:388:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (opt->optvalue) != 1) data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:406:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (opt->optvalue) != 3) data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:431:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (opt->optvalue) != 1) data/mpsolve-3.2.1/src/mpsolve/mpsolve.c:457:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen (opt->optvalue) != 1) data/mpsolve-3.2.1/src/tests/check_implementation.c:26:35: [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). const char * start = pol_path + strlen (pol_path) - 1; data/mpsolve-3.2.1/src/tests/check_implementation.c:99: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). path_length = 1 + strlen (pol_name) + strlen (type_name) + 7; data/mpsolve-3.2.1/src/tests/check_implementation.c:99: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). path_length = 1 + strlen (pol_name) + strlen (type_name) + 7; data/mpsolve-3.2.1/src/tests/check_implementation.c:102: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). path_length = strlen (pol_name) + strlen (srcdir_path) + strlen (type_name) + 7; data/mpsolve-3.2.1/src/tests/check_implementation.c:102: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). path_length = strlen (pol_name) + strlen (srcdir_path) + strlen (type_name) + 7; data/mpsolve-3.2.1/src/tests/check_implementation.c:102:62: [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). path_length = strlen (pol_name) + strlen (srcdir_path) + strlen (type_name) + 7; data/mpsolve-3.2.1/src/tests/check_implementation.c:108: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 (final_path, "/"); data/mpsolve-3.2.1/src/tests/check_implementation.c:110: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 (final_path, "/"); data/mpsolve-3.2.1/src/tests/check_implementation.c:133: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). path_length = 1 + strlen (pol_name) + strlen (type_name) + 19; data/mpsolve-3.2.1/src/tests/check_implementation.c:133: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). path_length = 1 + strlen (pol_name) + strlen (type_name) + 19; data/mpsolve-3.2.1/src/tests/check_implementation.c:136: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). path_length = strlen (pol_name) + strlen (srcdir_path) + strlen (type_name) + 19; data/mpsolve-3.2.1/src/tests/check_implementation.c:136: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). path_length = strlen (pol_name) + strlen (srcdir_path) + strlen (type_name) + 19; data/mpsolve-3.2.1/src/tests/check_implementation.c:136:62: [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). path_length = strlen (pol_name) + strlen (srcdir_path) + strlen (type_name) + 19; data/mpsolve-3.2.1/src/tests/check_implementation.c:142: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 (final_path, "/"); data/mpsolve-3.2.1/src/tests/check_implementation.c:144: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 (final_path, "/"); data/mpsolve-3.2.1/src/tests/check_implementation.c:146: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 (final_path, "/"); data/mpsolve-3.2.1/src/tests/check_implementation.c:148: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 (final_path, "/"); data/mpsolve-3.2.1/src/tests/check_secsolve.c:99:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (isspace (ch = getc (result_stream))) data/mpsolve-3.2.1/src/tests/check_unisolve.c:96:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (isspace (ch = getc (result_stream))) ANALYSIS SUMMARY: Hits = 179 Lines analyzed = 48426 in approximately 1.33 seconds (36489 lines/second) Physical Source Lines of Code (SLOC) = 30262 Hits@level = [0] 323 [1] 62 [2] 49 [3] 23 [4] 45 [5] 0 Hits@level+ = [0+] 502 [1+] 179 [2+] 117 [3+] 68 [4+] 45 [5+] 0 Hits/KSLOC@level+ = [0+] 16.5885 [1+] 5.91501 [2+] 3.86623 [3+] 2.24704 [4+] 1.48701 [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.