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/toulbar2-1.0.0+dfsg3/misc/script/wcsp-better-top.cc Examining data/toulbar2-1.0.0+dfsg3/src/ToulbarVersion.cpp Examining data/toulbar2-1.0.0+dfsg3/src/ToulbarVersion.hpp Examining data/toulbar2-1.0.0+dfsg3/src/applis/tb2bep.cpp Examining data/toulbar2-1.0.0+dfsg3/src/applis/tb2bep.hpp Examining data/toulbar2-1.0.0+dfsg3/src/applis/tb2haplotype.cpp Examining data/toulbar2-1.0.0+dfsg3/src/applis/tb2haplotype.hpp Examining data/toulbar2-1.0.0+dfsg3/src/applis/tb2pedigree.cpp Examining data/toulbar2-1.0.0+dfsg3/src/applis/tb2pedigree.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2abstractconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2abstractconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2arithmetic.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2arithmetic.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2binconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2binconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2clause.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2clqcover.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2clqcover.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2constraint.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2constraint.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2domain.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2domain.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2enumvar.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2enumvar.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2globaldecomposable.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2globaldecomposable.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2intervar.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2intervar.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2naryconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2naryconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2ternaryconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2ternaryconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2types.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2vac.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2vac.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2vacutils.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2vacutils.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2variable.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2variable.hpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp Examining data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2alldiffconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2alldiffconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2amongconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2amongconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2dpglobalconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2dpglobalconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2flowbasedconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2flowbasedconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalcardinalityconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalcardinalityconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2grammarconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2grammarconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2grammarutils.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2grammarutils.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2graph.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2graph.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2linearconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2linearconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2lpsconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2lpsconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2maxconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2maxconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2mipsolver.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2mipsolver.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2regulardpconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2regulardpconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2regularflowconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2regularflowconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2sameconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2sameconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2treeconstr.cpp Examining data/toulbar2-1.0.0+dfsg3/src/globals/tb2treeconstr.hpp Examining data/toulbar2-1.0.0+dfsg3/src/ilog/iloglue.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/autotuning2.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/autotuning2.h Examining data/toulbar2-1.0.0+dfsg3/src/incop/csproblem.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/csproblem.h Examining data/toulbar2-1.0.0+dfsg3/src/incop/incop.h Examining data/toulbar2-1.0.0+dfsg3/src/incop/incopalgo.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/incoputil.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/incoputil.h Examining data/toulbar2-1.0.0+dfsg3/src/incop/narycsproblem.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/narycsproblem.h Examining data/toulbar2-1.0.0+dfsg3/src/incop/timer.cpp Examining data/toulbar2-1.0.0+dfsg3/src/incop/timer.h Examining data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp Examining data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp Examining data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.hpp Examining data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp Examining data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.hpp Examining data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp Examining data/toulbar2-1.0.0+dfsg3/src/toulbar2lib.hpp Examining data/toulbar2-1.0.0+dfsg3/src/toulbar2test.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h Examining data/toulbar2-1.0.0+dfsg3/src/utils/SimpleOpt.h Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2automaton.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2automaton.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2boostgraph.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2btlist.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2btqueue.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2btqueue.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2integer.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2paretopair.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2queue.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2queue.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2randomgen.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2randomgen.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2store.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.cpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp Examining data/toulbar2-1.0.0+dfsg3/src/utils/tb2utils.hpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2cpdgvns.cpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2cpdgvns.hpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2dgvns.cpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2dgvns.hpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2localsearch.cpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2localsearch.hpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2rpdgvns.cpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2rpdgvns.hpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2vns.cpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2vns.hpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2vnsutils.cpp Examining data/toulbar2-1.0.0+dfsg3/src/vns/tb2vnsutils.hpp Examining data/toulbar2-1.0.0+dfsg3/src/xmlcsp/C_AST.h Examining data/toulbar2-1.0.0+dfsg3/src/xmlcsp/XMLParser_constants.h Examining data/toulbar2-1.0.0+dfsg3/src/xmlcsp/xmlcsp.h FINAL RESULTS: data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2257: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(Pb_basename, ToulBar2::problemsaved_filename.c_str()); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2258: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(Pb_graph, Pb_basename); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2259: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(Pb_degree, Pb_basename); data/toulbar2-1.0.0+dfsg3/src/incop/incoputil.cpp:595:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s%s", "results/", argv[2]); data/toulbar2-1.0.0+dfsg3/src/incop/incoputil.cpp:597:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s-%s", filename, argv[i]); data/toulbar2-1.0.0+dfsg3/src/incop/narycsproblem.cpp:425:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line, "bin/Linux/narycsp %s %s %s", outputfile.c_str(), filename.c_str(), cmd.c_str()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:892:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(clusterVarsFilename, "%s.info/%d.vars", getWCSP()->getName().c_str(), getId()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:893:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sepVarsFilename, "%s.info/%d.sep", getWCSP()->getName().c_str(), getId()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:894:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sonsFilename, "%s.info/%d.sons", getWCSP()->getName().c_str(), getId()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:895:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fatherFilename, "%s.info/%d.father", getWCSP()->getName().c_str(), getId()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:896:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sepSizeFilename, "%s.info/%d.sepsize", getWCSP()->getName().c_str(), getId()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:2407:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmpName, "%s.info", getWCSP()->getName().c_str()); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:2414:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmpName, "%s.info/root", getWCSP()->getName().c_str()); data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1833:13: [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(ToulBar2::solution_uai_file, PrintFormatProb, (wcsp->LogSumExp(ToulBar2::logZ, ToulBar2::logU) + ToulBar2::markov_log) / Log(10.)); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:42:18: [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. #define _tprintf printf data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:536:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bin_path, "%s%c", buffer, PATH_SEP_CHR); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:540:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bin_path, "%s%c", buffer, PATH_SEP_CHR); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:552:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bin_path, "%s%c", buffer, PATH_SEP_CHR); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1117:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1120:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ToulBar2::varOrder, "%s", buf); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1130:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1165:21: [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(tmpFile, args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1627:21: [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(tmpFile, args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1910:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ToulBar2::varOrder, "%s", problem.c_str()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1921:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ToulBar2::varOrder, "%s", problem.c_str()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1955:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(certificateFilename, "%s", problem.c_str()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1996:13: [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(tmpPath, argv[0]); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:2000:13: [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(tmpFile, strfile.c_str()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:2144:17: [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(ToulBar2::solution_uai_file, PrintFormatProb, -numeric_limits<TProb>::infinity()); data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:175:32: [4] (buffer) _mbscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. #define sg_strcpy_s(a, n, b) ::_mbscpy(a, b) data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:189:32: [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). #define sg_strcpy_s(a, n, b) ::strcpy(a, b) data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:266:11: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. ::wcscpy(dst, src); data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:27:16: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. #define Strcpy wcscpy data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:38:16: [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). #define Strcpy strcpy data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:40:16: [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). #define Strcat strcat data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:323:25: [3] (random) setstate: 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. ToulBar2::vnsOutput.setstate(std::ios::failbit); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:544:19: [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. path = strdup(getenv("PATH")); data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:69:30: [3] (random) lrand48: 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. inline int myrand() { return lrand48(); } data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:70:45: [3] (random) lrand48: 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. inline Long myrandl() { return (Long)((Long)lrand48() /**LONGLONG_MAX*/); } data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:71:34: [3] (random) drand48: 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. inline double mydrand() { return drand48(); } data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:76:12: [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. return srand(seed); data/toulbar2-1.0.0+dfsg3/src/applis/tb2haplotype.cpp:135:14: [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). fmap.open(strmap.c_str()); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2253:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Pb_basename[512]; data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2254:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Pb_graph[512]; data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2255:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Pb_degree[512]; data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2333:9: [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(Pb_graph, ".dot"); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:2399:9: [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(Pb_degree, ".degree"); // after preprocessing data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:3678:10: [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). file.open(filename); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:3829:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file.open(elimVarOrder); data/toulbar2-1.0.0+dfsg3/src/ilog/iloglue.cpp:456: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). ToulBar2::verbose = atoi(argv[2]); data/toulbar2-1.0.0+dfsg3/src/ilog/iloglue.cpp:482:13: [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(name, "x%d", i); data/toulbar2-1.0.0+dfsg3/src/incop/narycsproblem.cpp:414:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[1024]; data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:389:52: [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). addOpenNode(*(cluster->cp), *(cluster->open), bestlb, cluster->getCurrentDelta()); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:521:48: [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). c->nogoodGet(lbSon, ubSon, &c->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:529:50: [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). c->nogoodGet(dummylb, tmpub, &c->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:558:101: [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). c->nogoodRec(res.first, ((res.second < ubSon) ? res.second : MAX_COST), &c->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:568:59: [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). c->nogoodRec(ubSon, MAX_COST, &c->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:627:43: [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). OpenList* prevopen = cluster->open; data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:631:107: [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). assert(cluster == wcsp->getTreeDec()->getRoot() || cluster->nogoodGet(tmplb, tmpub, &cluster->open)); // warning! it can destroy cluster->ub data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:633:41: [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). assert(prevopen == cluster->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:635:52: [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). addOpenNode(*(cluster->cp), *(cluster->open), bestlb, cluster->getCurrentDelta()); // reinsert as a new open node data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:684:50: [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). c->nogoodGet(nogoodlb, nogoodub, &c->open); // update c->open and c->ub data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:719:83: [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). c->nogoodRec(res.first, ((res.second < cub) ? res.second : MAX_COST), &c->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:733:41: [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). c->nogoodRec(cub, MAX_COST, &c->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:740:16: [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 (c->open) data/toulbar2-1.0.0+dfsg3/src/search/tb2btd.cpp:741:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). *(c->open) = OpenList(); // clear current open list data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:144:37: [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). get(clb, cub, &cluster->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:184:60: [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). void Separator::set(Cost clb, Cost cub, Solver::OpenList** open) data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:213:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (open) { data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:214:14: [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 (*open) { data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:298:62: [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). bool Separator::get(Cost& clb, Cost& cub, Solver::OpenList** open) data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:328:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (open) data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:342:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (open) data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:529:7: [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). , open(NULL) data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:886:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char clusterVarsFilename[128]; data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:887:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sepVarsFilename[128]; data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:888:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sonsFilename[128]; data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:889:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fatherFilename[128]; data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:890:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sepSizeFilename[128]; data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.cpp:2406:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpName[256]; data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.hpp:165:23: [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). Solver::OpenList* open; // list of open nodes related to this cluster data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.hpp:246:32: [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). sep->set(clb, cub, open); data/toulbar2-1.0.0+dfsg3/src/search/tb2clusters.hpp:248:102: [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). bool nogoodGet(Cost& clb, Cost& cub, Solver::OpenList** open = NULL) { return sep->get(clb, cub, open); } data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:73:7: [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). , open(NULL) data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:91:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). delete open; data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:868:27: [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). addOpenNode(*cp, *open, MAX(lb, wcsp->getLb())); data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1317:31: [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 (!cluster->open) data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1322:31: [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 (!cluster->open) { data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1323:65: [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). cluster->nogoodRec(clb, MAX_COST, &cluster->open); // create an initial empty open list data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1327:29: [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). assert(cluster->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1328:30: [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). open_ = cluster->open; data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1330:43: [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). OpenList* prevopen = cluster->open; data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1333:107: [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). assert(cluster == wcsp->getTreeDec()->getRoot() || cluster->nogoodGet(tmplb, tmpub, &cluster->open)); data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1334:41: [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). assert(prevopen == cluster->open); data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1344: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 (open != NULL) data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1345:24: [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). delete open; data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:1347: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). open_ = open; data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:2080:49: [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). void Solver::addOpenNode(CPStore& cp, OpenList& open, Cost lb, Cost delta) data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.cpp:2089:5: [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). open.push(OpenNode(MAX(MIN_COST, lb + delta), cp.start, idx)); data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.hpp:134:45: [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). void addOpenNode(CPStore& cp, OpenList& open, Cost lb, Cost delta = MIN_COST); ///< \param delta cost moved out from the cluster by soft arc consistency data/toulbar2-1.0.0+dfsg3/src/search/tb2solver.hpp:161:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). OpenList* open; // list of open nodes (except BTD) data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:44: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). #define _ttoi atoi data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:532:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char bin_path[512]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:549:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char bin_path[512]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:811:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:884:28: [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). mode = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:964:41: [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). ToulBar2::vnsOutput.open(args.OptionArg(), data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:981:79: [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). ToulBar2::vnsInitSol = static_cast<VNSSolutionInitMethod>(atoi(args.OptionArg())); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:985: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). ToulBar2::vnsLDSmin = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:989: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). ToulBar2::vnsLDSmax = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:993:63: [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). ToulBar2::vnsLDSinc = static_cast<VNSInc>(atoi(args.OptionArg())); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:997:41: [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). ToulBar2::vnsKmin = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1001:41: [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). ToulBar2::vnsKmax = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1005:61: [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). ToulBar2::vnsKinc = static_cast<VNSInc>(atoi(args.OptionArg())); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1056:28: [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 root = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1063: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). int subcluster = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1069:32: [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 cmaxsize = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1092: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). int sepmaxsize = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1098:35: [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 minpvarsize = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1114:36: [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 varElimOrder = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1116:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1129:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1167:60: [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). ToulBar2::pedigreeCorrectionMode = atoi(tmpFile); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1175: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). int penaltyThreshold = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1225:32: [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 dico = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1242:41: [2] (integer) atol: 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 weightedtight = atol(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1256:38: [2] (integer) atol: 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 weighteddegree = atol(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1268: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). ToulBar2::nbDecisionVars = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1280:27: [2] (integer) atol: 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). ndegree = atol(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1295:31: [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). ndegree = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1318:27: [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 nit = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1328: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). int depth = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1368:32: [2] (integer) atol: 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 size = atol(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1384:32: [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 func = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1414:31: [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 dee = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1427:35: [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 maxnary = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1454: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). int maxlds = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1535:52: [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). LcLevelType lclevel = (LcLevelType)atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1566: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). ToulBar2::resolution = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1612:41: [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). ToulBar2::verbose = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1629:46: [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). ToulBar2::dumpWCSP = atoi(tmpFile); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1648:39: [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). ToulBar2::debug = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1684:31: [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). timeout = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1692:28: [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 seed = atoi(args.OptionArg()); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1988:38: [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). ToulBar2::solutionFile = fopen(ToulBar2::writeSolution, "w"); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:2013:43: [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). ToulBar2::solution_uai_file = fopen(ToulBar2::solution_uai_filename.c_str(), "w"); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:2063:17: [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(pch); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:2065:17: [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). m = atoi(pch); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:2070:36: [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). pn[narities] = atoi(pch); data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:463:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX] = { 0 }; data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:548:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX] = { 0 }; data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:1975:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Rfile.open(fileName); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:2096:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Rfile.open(fileName); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:2622:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Rfile.open(fileName); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:2937:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fevid.open(strevid.c_str()); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:3044:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). sol.open(ToulBar2::writeSolution); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:3071:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Rfile.open(fileName); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:3255:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Rfile.open(fileName); data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:140:50: [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). inline int string2Cost(const char* ptr) { return atoi(ptr); } data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:207:12: [2] (integer) atol: 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). return atol(ptr); data/toulbar2-1.0.0+dfsg3/src/applis/tb2bep.cpp:11:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void BEP::read(const char* fileName, WCSP* wcsp) data/toulbar2-1.0.0+dfsg3/src/applis/tb2bep.hpp:25:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const char* fileName, WCSP* wcsp); data/toulbar2-1.0.0+dfsg3/src/applis/tb2haplotype.cpp:103:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Haplotype::read(const char* fileName, WCSP* wcsp) data/toulbar2-1.0.0+dfsg3/src/applis/tb2haplotype.hpp:64:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const char* fileName, WCSP* wcsp); data/toulbar2-1.0.0+dfsg3/src/applis/tb2pedigree.cpp:127:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Pedigree::read(const char* fileName, WCSP* wcsp) data/toulbar2-1.0.0+dfsg3/src/applis/tb2pedigree.hpp:66:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(const char* fileName, WCSP* wcsp); data/toulbar2-1.0.0+dfsg3/src/core/tb2clqcover.cpp:561:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void CliqueConstraint::read(istream& is) data/toulbar2-1.0.0+dfsg3/src/core/tb2clqcover.hpp:21:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:1045:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gc->read(file, mult); data/toulbar2-1.0.0+dfsg3/src/core/tb2wcsp.cpp:1109:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cc->read(file); data/toulbar2-1.0.0+dfsg3/src/globals/tb2alldiffconstr.cpp:32:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void AllDiffConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2alldiffconstr.hpp:39:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2amongconstr.cpp:22:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void AmongConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2amongconstr.hpp:67:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalcardinalityconstr.cpp:37:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GlobalCardinalityConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalcardinalityconstr.hpp:45:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2globalconstr.hpp:153:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(istream& file, bool mult = true) = 0; data/toulbar2-1.0.0+dfsg3/src/globals/tb2grammarconstr.cpp:23:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void GrammarConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2grammarconstr.hpp:81:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2linearconstr.hpp:85:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(istream& file, bool mult = true) {} data/toulbar2-1.0.0+dfsg3/src/globals/tb2lpsconstr.cpp:35:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void LPSConstraint::read(istream& file, bool mult = true) data/toulbar2-1.0.0+dfsg3/src/globals/tb2lpsconstr.hpp:40:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2maxconstr.cpp:16:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void MaxConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2maxconstr.hpp:69:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2regulardpconstr.cpp:17:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void RegularDPConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2regulardpconstr.hpp:155:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2regularflowconstr.cpp:27:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void RegularFlowConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2regularflowconstr.hpp:167:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2sameconstr.cpp:43:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void SameConstraint::read(istream& file, bool mult) data/toulbar2-1.0.0+dfsg3/src/globals/tb2sameconstr.hpp:42:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true); data/toulbar2-1.0.0+dfsg3/src/globals/tb2treeconstr.hpp:199:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(istream& file, bool mult = true) {} //No parameter needed data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:535:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, bin_name, buflen); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:538:13: [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(buffer, "."); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:550:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, tok, buflen); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1119: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). ToulBar2::varOrder = new char[strlen(buf) + 1]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1164:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* tmpFile = new char[strlen(args.OptionArg()) + 1]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1166: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). if (strlen(tmpFile) == 1 && (tmpFile[0] == '0' || tmpFile[0] == '1' || tmpFile[0] == '2')) data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1626:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* tmpFile = new char[strlen(args.OptionArg()) + 1]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1628: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). if (strlen(tmpFile) == 1 && (tmpFile[0] == '1' || tmpFile[0] == '2')) data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1995: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* tmpPath = new char[strlen(argv[0]) + 1]; data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1998:17: [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(tmpPath, "."); data/toulbar2-1.0.0+dfsg3/src/tb2main.cpp:1999: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* tmpFile = new char[strlen(strfile.c_str()) + 1]; data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:171:21: [1] (buffer) _mbslen: 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 sg_strlen ::_mbslen data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:188: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 sg_strlen ::strlen data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:246: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). static size_t strlen(const char* s) { return ::strlen(s); } data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:246: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). static size_t strlen(const char* s) { return ::strlen(s); } data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:247: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). static size_t strlen(const wchar_t* s) { return ::wcslen(s); } data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:247:55: [1] (buffer) wcslen: 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). static size_t strlen(const wchar_t* s) { return ::wcslen(s); } data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:249: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). static size_t strlen(const UChar* s) data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:434:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(m_glob.gl_pathv[m_uiCurr]); data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:867:42: [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 uiPrefixLen = SimpleGlobUtil::strlen(m_szPathPrefix); data/toulbar2-1.0.0+dfsg3/src/utils/SimpleGlob.h:868:50: [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 uiLen = uiPrefixLen + SimpleGlobUtil::strlen(a_pszFileName) + 1; data/toulbar2-1.0.0+dfsg3/src/utils/tb2integer.hpp:127:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(p) > 300) data/toulbar2-1.0.0+dfsg3/src/utils/tb2integer.hpp:133: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(p) - 1 < 10) data/toulbar2-1.0.0+dfsg3/src/utils/tb2integer.hpp:134: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). os << "e+0" << strlen(p) - 1; data/toulbar2-1.0.0+dfsg3/src/utils/tb2integer.hpp:136:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). os << "e+" << strlen(p) - 1; data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:2041:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ToulBar2::haplotype->read(fileName, this); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:2045:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ToulBar2::pedigree->read(fileName, this); data/toulbar2-1.0.0+dfsg3/src/utils/tb2reader.cpp:2056:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ToulBar2::bep->read(fileName, this); data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:33:16: [1] (buffer) wcslen: 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 Strlen wcslen data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:39:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). #define Strncpy strncpy data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:41:17: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. #define Strncat strncat data/toulbar2-1.0.0+dfsg3/src/utils/tb2system.hpp:44: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). #define Strlen strlen ANALYSIS SUMMARY: Hits = 223 Lines analyzed = 58510 in approximately 1.47 seconds (39762 lines/second) Physical Source Lines of Code (SLOC) = 45644 Hits@level = [0] 20 [1] 63 [2] 119 [3] 6 [4] 35 [5] 0 Hits@level+ = [0+] 243 [1+] 223 [2+] 160 [3+] 41 [4+] 35 [5+] 0 Hits/KSLOC@level+ = [0+] 5.32381 [1+] 4.88564 [2+] 3.50539 [3+] 0.898256 [4+] 0.766804 [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.