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/hyphy-2.5.23+dfsg/contrib/cl2hdr.c Examining data/hyphy-2.5.23+dfsg/src/contrib/gnuregex.h Examining data/hyphy-2.5.23+dfsg/src/contrib/mersenne_twister.cpp Examining data/hyphy-2.5.23+dfsg/src/contrib/mersenne_twister.h Examining data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp Examining data/hyphy-2.5.23+dfsg/src/core/_hyExecutionContext.cpp Examining data/hyphy-2.5.23+dfsg/src/core/alignment.cpp Examining data/hyphy-2.5.23+dfsg/src/core/associative_list.cpp Examining data/hyphy-2.5.23+dfsg/src/core/avllist.cpp Examining data/hyphy-2.5.23+dfsg/src/core/avllistx.cpp Examining data/hyphy-2.5.23+dfsg/src/core/avllistx_iterator.cpp Examining data/hyphy-2.5.23+dfsg/src/core/avllistxl.cpp Examining data/hyphy-2.5.23+dfsg/src/core/avllistxl_iterator.cpp Examining data/hyphy-2.5.23+dfsg/src/core/baseobj.cpp Examining data/hyphy-2.5.23+dfsg/src/core/batchlan.cpp Examining data/hyphy-2.5.23+dfsg/src/core/batchlan2.cpp Examining data/hyphy-2.5.23+dfsg/src/core/batchlanhelpers.cpp Examining data/hyphy-2.5.23+dfsg/src/core/batchlanruntime.cpp Examining data/hyphy-2.5.23+dfsg/src/core/calcnode.cpp Examining data/hyphy-2.5.23+dfsg/src/core/category.cpp Examining data/hyphy-2.5.23+dfsg/src/core/constant.cpp Examining data/hyphy-2.5.23+dfsg/src/core/dataset.cpp Examining data/hyphy-2.5.23+dfsg/src/core/dataset_filter.cpp Examining data/hyphy-2.5.23+dfsg/src/core/dataset_filter_numeric.cpp Examining data/hyphy-2.5.23+dfsg/src/core/fisher_exact.cpp Examining data/hyphy-2.5.23+dfsg/src/core/formula.cpp Examining data/hyphy-2.5.23+dfsg/src/core/formula_parsing_context.cpp Examining data/hyphy-2.5.23+dfsg/src/core/fstring.cpp Examining data/hyphy-2.5.23+dfsg/src/core/global_object_lists.cpp Examining data/hyphy-2.5.23+dfsg/src/core/global_things.cpp Examining data/hyphy-2.5.23+dfsg/src/core/hbl_env.cpp Examining data/hyphy-2.5.23+dfsg/src/core/include/_hyExecutionContext.h Examining data/hyphy-2.5.23+dfsg/src/core/include/alignment.h Examining data/hyphy-2.5.23+dfsg/src/core/include/associative_list.h Examining data/hyphy-2.5.23+dfsg/src/core/include/avllist.h Examining data/hyphy-2.5.23+dfsg/src/core/include/avllistx.h Examining data/hyphy-2.5.23+dfsg/src/core/include/avllistx_iterator.h Examining data/hyphy-2.5.23+dfsg/src/core/include/avllistxl.h Examining data/hyphy-2.5.23+dfsg/src/core/include/avllistxl_iterator.h Examining data/hyphy-2.5.23+dfsg/src/core/include/baseobj.h Examining data/hyphy-2.5.23+dfsg/src/core/include/batchlan.h Examining data/hyphy-2.5.23+dfsg/src/core/include/calcnode copy.h Examining data/hyphy-2.5.23+dfsg/src/core/include/calcnode.h Examining data/hyphy-2.5.23+dfsg/src/core/include/category.h Examining data/hyphy-2.5.23+dfsg/src/core/include/classes.h Examining data/hyphy-2.5.23+dfsg/src/core/include/constant.h Examining data/hyphy-2.5.23+dfsg/src/core/include/dataset.h Examining data/hyphy-2.5.23+dfsg/src/core/include/dataset_filter.h Examining data/hyphy-2.5.23+dfsg/src/core/include/dataset_filter_numeric.h Examining data/hyphy-2.5.23+dfsg/src/core/include/defines.h Examining data/hyphy-2.5.23+dfsg/src/core/include/formula.h Examining data/hyphy-2.5.23+dfsg/src/core/include/formula_parsing_context.h Examining data/hyphy-2.5.23+dfsg/src/core/include/fstring.h Examining data/hyphy-2.5.23+dfsg/src/core/include/function_templates.h Examining data/hyphy-2.5.23+dfsg/src/core/include/global_object_lists.h Examining data/hyphy-2.5.23+dfsg/src/core/include/global_things.h Examining data/hyphy-2.5.23+dfsg/src/core/include/hbl_env.h Examining data/hyphy-2.5.23+dfsg/src/core/include/hy_string_buffer.h Examining data/hyphy-2.5.23+dfsg/src/core/include/hy_strings.h Examining data/hyphy-2.5.23+dfsg/src/core/include/hy_types.h Examining data/hyphy-2.5.23+dfsg/src/core/include/likefunc.h Examining data/hyphy-2.5.23+dfsg/src/core/include/list.h Examining data/hyphy-2.5.23+dfsg/src/core/include/mathobj.h Examining data/hyphy-2.5.23+dfsg/src/core/include/matrix.h Examining data/hyphy-2.5.23+dfsg/src/core/include/mypthread.h Examining data/hyphy-2.5.23+dfsg/src/core/include/ntuplestorage.h Examining data/hyphy-2.5.23+dfsg/src/core/include/operation.h Examining data/hyphy-2.5.23+dfsg/src/core/include/parser.h Examining data/hyphy-2.5.23+dfsg/src/core/include/polynoml.h Examining data/hyphy-2.5.23+dfsg/src/core/include/simplelist.h Examining data/hyphy-2.5.23+dfsg/src/core/include/site.h Examining data/hyphy-2.5.23+dfsg/src/core/include/stack.h Examining data/hyphy-2.5.23+dfsg/src/core/include/string_file_wrapper.h Examining data/hyphy-2.5.23+dfsg/src/core/include/time_difference.h Examining data/hyphy-2.5.23+dfsg/src/core/include/topology.h Examining data/hyphy-2.5.23+dfsg/src/core/include/translation_table.h Examining data/hyphy-2.5.23+dfsg/src/core/include/tree.h Examining data/hyphy-2.5.23+dfsg/src/core/include/tree_iterator.h Examining data/hyphy-2.5.23+dfsg/src/core/include/trie.h Examining data/hyphy-2.5.23+dfsg/src/core/include/trie_iterator.h Examining data/hyphy-2.5.23+dfsg/src/core/include/variable.h Examining data/hyphy-2.5.23+dfsg/src/core/include/variablecontainer.h Examining data/hyphy-2.5.23+dfsg/src/core/include/vector.h Examining data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp Examining data/hyphy-2.5.23+dfsg/src/core/likefunc2.cpp Examining data/hyphy-2.5.23+dfsg/src/core/likefuncocl.cpp Examining data/hyphy-2.5.23+dfsg/src/core/list.cpp Examining data/hyphy-2.5.23+dfsg/src/core/mathobj.cpp Examining data/hyphy-2.5.23+dfsg/src/core/matrix.cpp Examining data/hyphy-2.5.23+dfsg/src/core/nexus.cpp Examining data/hyphy-2.5.23+dfsg/src/core/ntuplestorage.cpp Examining data/hyphy-2.5.23+dfsg/src/core/operation.cpp Examining data/hyphy-2.5.23+dfsg/src/core/parser.cpp Examining data/hyphy-2.5.23+dfsg/src/core/parser2.cpp Examining data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp Examining data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp Examining data/hyphy-2.5.23+dfsg/src/core/site.cpp Examining data/hyphy-2.5.23+dfsg/src/core/stack.cpp Examining data/hyphy-2.5.23+dfsg/src/core/string_buffer.cpp Examining data/hyphy-2.5.23+dfsg/src/core/string_file_wrapper.cpp Examining data/hyphy-2.5.23+dfsg/src/core/strings.cpp Examining data/hyphy-2.5.23+dfsg/src/core/time_difference.cpp Examining data/hyphy-2.5.23+dfsg/src/core/topology.cpp Examining data/hyphy-2.5.23+dfsg/src/core/translation_table.cpp Examining data/hyphy-2.5.23+dfsg/src/core/tree.cpp Examining data/hyphy-2.5.23+dfsg/src/core/tree_evaluator.cpp Examining data/hyphy-2.5.23+dfsg/src/core/tree_iterator.cpp Examining data/hyphy-2.5.23+dfsg/src/core/trie.cpp Examining data/hyphy-2.5.23+dfsg/src/core/trie_iterator.cpp Examining data/hyphy-2.5.23+dfsg/src/core/variable.cpp Examining data/hyphy-2.5.23+dfsg/src/core/variablecontainer.cpp Examining data/hyphy-2.5.23+dfsg/src/core/vector.cpp Examining data/hyphy-2.5.23+dfsg/src/lib/link/THyPhy.cpp Examining data/hyphy-2.5.23+dfsg/src/lib/link/THyPhy.h Examining data/hyphy-2.5.23+dfsg/src/mains/unix.cpp Examining data/hyphy-2.5.23+dfsg/src/new/bayesgraph.cpp Examining data/hyphy-2.5.23+dfsg/src/new/bayesgraph2.cpp Examining data/hyphy-2.5.23+dfsg/src/new/bgm.cpp Examining data/hyphy-2.5.23+dfsg/src/new/bgm2.cpp Examining data/hyphy-2.5.23+dfsg/src/new/include/bayesgraph.h Examining data/hyphy-2.5.23+dfsg/src/new/include/bgm.h Examining data/hyphy-2.5.23+dfsg/src/new/include/scfg.h Examining data/hyphy-2.5.23+dfsg/src/new/scfg.cpp Examining data/hyphy-2.5.23+dfsg/src/utils/hyphyunixutils.cpp FINAL RESULTS: data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:539:36: [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 DEBUG_PRINT1(x) if (debug) printf (x) data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:540:41: [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 DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:541:45: [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 DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:542:49: [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 DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4979: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 (errbuf, msg); data/hyphy-2.5.23+dfsg/src/core/batchlan.cpp:1820:28: [4] (buffer) scanf: 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. local_object_manager < scanf; data/hyphy-2.5.23+dfsg/src/core/batchlanruntime.cpp:4084:21: [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 (do_markdown ? "\n%ld. [**%s**] %s" : "\n\t(%ld):[%s] %s", option+1UL, ((_String*)available_choices->GetItem (option, 0))->get_str(), ((_String*)available_choices->GetItem (option, 1))->get_str()); data/hyphy-2.5.23+dfsg/src/core/constant.cpp:652:5: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (buffer,256, format,Value()); data/hyphy-2.5.23+dfsg/src/core/global_things.cpp:505: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. fprintf (stderr, messages[file_index], prefix[file_index]->get_str()); data/hyphy-2.5.23+dfsg/src/core/parser.cpp:131:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (dump, length, value < 0 ? "-1e9999" : "1e9999"); data/hyphy-2.5.23+dfsg/src/core/parser.cpp:141:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (dump,length, PRINTF_FORMAT_STRING,value); data/hyphy-2.5.23+dfsg/src/core/parser.cpp:150:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (dump,length,(const char*)format,value); data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:2686:7: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (number, sizeof(number),PRINTF_FORMAT_STRING,coeff); data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:2749:13: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (number, sizeof(number),PRINTF_FORMAT_STRING,theTerms->GetCoeff(i)); data/hyphy-2.5.23+dfsg/src/core/string_file_wrapper.cpp:51:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf (file_buffer, buffer); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:139:16: [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. s_length = snprintf(s_val, 128, format ? format : PRINTF_FORMAT_STRING, val); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:153:16: [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. s_length = snprintf(s_val, 128, format_str, val); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:294:5: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system("cls"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:1094:3: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system("PAUSE"); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1580:11: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. _String random (length); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1588:9: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. random.set_char (c, alphabet->char_at(idx)); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1590:9: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. random.set_char (c,(char)(1UL+idx)); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1595:10: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. return random; data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:268:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* hyphyEnv = getenv("HYPHY_PATH"); data/hyphy-2.5.23+dfsg/contrib/cl2hdr.c:11: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 ibuf[1024], obuf[2048]; data/hyphy-2.5.23+dfsg/contrib/cl2hdr.c:18:11: [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). fpi = fopen(argv[1], "r"); data/hyphy-2.5.23+dfsg/contrib/cl2hdr.c:24:11: [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). fpo = fopen(argv[2], "w"); data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:82:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #ifndef bcopy data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:83:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s, d, n) memcpy ((d), (s), (n)) data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:83:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s, d, n) memcpy ((d), (s), (n)) data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:150:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char re_syntax_table[CHAR_SET_SIZE]; data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:277:4: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy (source, destination, osize), \ data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:1520: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 str[CHAR_CLASS_MAX_LENGTH + 1]; data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:2330:30: [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. range_start = ((unsigned char *) p)[-2]; data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:2331:30: [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. range_end = ((unsigned char *) p)[0]; data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4756:13: [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. return (char *) re_error_msg[(int) ret]; data/hyphy-2.5.23+dfsg/src/core/alignment.cpp:667:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( q_res, q_str, q_len + 1 ); data/hyphy-2.5.23+dfsg/src/core/alignment.cpp:686:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy( r_res, r_str, r_len + 1 ); data/hyphy-2.5.23+dfsg/src/core/constant.cpp:619: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 format[32], data/hyphy-2.5.23+dfsg/src/core/dataset_filter_numeric.cpp:109: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/hyphy-2.5.23+dfsg/src/core/fstring.cpp:846: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 buffer[2]; data/hyphy-2.5.23+dfsg/src/core/global_things.cpp:224:22: [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). daFile = fopen (fileName,mode); data/hyphy-2.5.23+dfsg/src/core/global_things.cpp:818: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 time_buffer [128]; data/hyphy-2.5.23+dfsg/src/core/global_things.cpp:836:32: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fileDescriptor = mkstemp(tmpFileName); data/hyphy-2.5.23+dfsg/src/core/include/dataset_filter.h:224:23: [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 * site1c[3] = {GetColumn(site1),GetColumn(site1+1),GetColumn(site1+2)}, data/hyphy-2.5.23+dfsg/src/core/include/dataset_filter.h:239:23: [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 * site1c[2] = {GetColumn(site1),GetColumn(site1+1)}, data/hyphy-2.5.23+dfsg/src/core/include/hy_strings.h:1028:76: [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). template <class DELIM> long ExtractEnclosedExpression (long& from, DELIM open, DELIM close, int options) const { data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:460:13: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:491:13: [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 [1024]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:2343: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 buffer [2048]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:3745: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 buffer [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:3973: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 buffer [1024]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:4302: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 buffer[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:4320: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 buffer[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5356: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 [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5373: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 buf [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5397:35: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5410:27: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5439:31: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5454:27: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5478: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. char buf [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5495: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5512: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5519:13: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5536: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5555: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5580: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5591: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5602: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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5617: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 buf [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5633:10: [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[256], buf2[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5642: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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:5808:13: [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/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6404: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 buffer[1024]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6542: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 buffer[128]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6707:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6751:19: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6796:19: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6803: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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6826:22: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6852:10: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6860: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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6870:13: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:6970: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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7018: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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7025:25: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7043:25: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7071: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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7080:19: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7085: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[256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7093:25: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7100:25: [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 [256]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7221: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 buffer [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7231: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 buffer [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7256:13: [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[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7313:13: [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[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7324: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 buffer[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7386:25: [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[512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:7435: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 buffer [2048]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:9048:13: [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 [128]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:9243: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 buffer[64]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:9265: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 buffer [512]; data/hyphy-2.5.23+dfsg/src/core/likefunc.cpp:9554: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 str[4096]; data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:557:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void*)targetMatrix->theIndex,(void*)sourceMatrix->theIndex,sourceMatrix->lDim*sizeof(long)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:561:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void*)targetMatrix->compressedIndex,(void*)sourceMatrix->compressedIndex,sizeof(long) *(sourceMatrix->lDim+sourceMatrix->hDim)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:578:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((void*)targetMatrix->theData,(void*)sourceMatrix->theData,sourceMatrix->lDim*sizeof(void*)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:617:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((hyPointer)targetMatrix->theData,(hyPointer)sourceMatrix->theData,sizeof(hyFloat)*sourceMatrix->lDim); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:2662:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (cmd->formulaRefs, references.list_data, allocation_size); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:3313:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (storage.theData, theData, sizeof (hyFloat)*lDim); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:5151:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (stash, theData, sizeof (hyFloat)*lDim); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:5195:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (compressedIndex, by_column_counts, sizeof (long)*(lDim+hDim)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:5363:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (stash2, theData, sizeof (hyFloat) * lDim); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:5453:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (temp.theData, theData, sizeof (hyFloat) * hDim*vDim); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:5479:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (temp.theData, tempS.theData, lDim * sizeof (hyFloat)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:5526:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(theData, stash2, sizeof (hyFloat) * lDim); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:6932:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (theData, stash, lDim * sizeof (hyFloat)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8236:13: [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[255]; data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8309:14: [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 number_buffer [256]; data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8437: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 buffer[255],fc=0; data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8450: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). mDim = atol (buffer); // matrix dimension data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8493:13: [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). m = atol (buffer); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8529:17: [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). c1<<atol (buffer); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8546:17: [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). c2<<atol (buffer); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8656:13: [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 be[100]; data/hyphy-2.5.23+dfsg/src/core/parser.cpp:158: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 dump [256]; data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:109:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (theCoeff,theCoeffs,sizeof(hyFloat)*terms); data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:148:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (theCoeff, s->theCoeff, sizeof (hyFloat)*actTerms); data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:151:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (thePowers, s->thePowers, sizeof(long)*actTerms*numberVars); data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:390: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 bits[sizeof(long)*8]; data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:2271:22: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bits[sizeof(long)*8]; data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:2676:7: [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 number [100]; data/hyphy-2.5.23+dfsg/src/core/polynoml.cpp:2748:13: [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 number [100]; data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp:188:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (list_data,l.list_data,lLength*sizeof (hyPointer)); data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp:200:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (list_data,l.list_data,lLength*sizeof (hyPointer)); data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp:217:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(res.list_data,list_data,lLength*sizeof(void*)); data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp:221:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char*)res.list_data+lLength*sizeof(void*),l.list_data, l.lLength*sizeof(void*)); data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp:700:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (list_data, l->list_data, lLength*sizeof (hyPointer)); data/hyphy-2.5.23+dfsg/src/core/simplelist.cpp:1462: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 c[32]; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:58:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char valid_chars[256]; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:117: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 s[64]; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:138: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 s_val[128]; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:146: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 format_str[64]; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:152: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 s_val[128]; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:258:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (s_data + i * str.s_length, str.s_data, str.s_length); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:370:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (s_data, source_string, length); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:693:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(res.s_data, s_data, s_length); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:697:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(res.s_data + s_length, rhs.s_data, rhs.s_length); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:713:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(res.s_data, s_data, start); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:716:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(res.s_data + start, s_data + end + 1L, s_length - end - 1L); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1310: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 quotes [2] = {'"','\''}; data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1410: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[512]; data/hyphy-2.5.23+dfsg/src/core/topology.cpp:492:25: [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 [kBLLookahead+1]; data/hyphy-2.5.23+dfsg/src/core/topology.cpp:493:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (buffer, parms.get_str() + i + 1, kBLLookahead); data/hyphy-2.5.23+dfsg/src/core/topology.cpp:1675: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 buffer[256]; data/hyphy-2.5.23+dfsg/src/core/topology.cpp:1710: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 buffer[256]; data/hyphy-2.5.23+dfsg/src/core/tree_evaluator.cpp:1635:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (state, childVector, sizeof (hyFloat) * alphabetDimension); data/hyphy-2.5.23+dfsg/src/lib/link/THyPhy.cpp:125:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (sData,characters,length+1); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:238:3: [2] (buffer) TCHAR: 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. TCHAR buffer[_HYPHY_MAX_PATH_LENGTH]; data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:243: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 curWd[_HYPHY_MAX_PATH_LENGTH]; data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:305:23: [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* modelList = fopen (fileIndex.get_str(),"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:308:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). modelList = fopen (fileIndex.get_str(),"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:356: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* modelList = fopen (fileIndex.get_str(),"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:382:35: [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* dummyFile = fopen (fileIndex,"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:385:33: [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). dummyFile = fopen (fileIndex,"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:741: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 curWd[4096], data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:926:31: [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 * testPrefFile = fopen (prefFile.get_str(),"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:929: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). testPrefFile = fopen (prefFile.get_str(),"r"); data/hyphy-2.5.23+dfsg/src/mains/unix.cpp:987: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[256]; data/hyphy-2.5.23+dfsg/src/new/bayesgraph.cpp:1417:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mpi_message [256]; data/hyphy-2.5.23+dfsg/src/new/bgm.cpp:379: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 [256]; data/hyphy-2.5.23+dfsg/src/new/bgm.cpp:532: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 [255]; data/hyphy-2.5.23+dfsg/src/new/bgm.cpp:1352: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 mpi_message [256]; data/hyphy-2.5.23+dfsg/src/new/bgm.cpp:1988: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 [255]; data/hyphy-2.5.23+dfsg/src/new/bgm.cpp:2626: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 [255]; data/hyphy-2.5.23+dfsg/src/new/bgm.cpp:3141: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 [255]; data/hyphy-2.5.23+dfsg/src/new/bgm2.cpp:184: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 [256]; data/hyphy-2.5.23+dfsg/src/new/bgm2.cpp:270: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 [256]; data/hyphy-2.5.23+dfsg/src/utils/hyphyunixutils.cpp:101: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 cErr [CURL_ERROR_SIZE+1]; data/hyphy-2.5.23+dfsg/src/utils/hyphyunixutils.cpp:104:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen (fileName->get_str(),"wb"); data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4753: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). ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4763: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). const int len = strlen (s); data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4856: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). ret = regex_compile (pattern, strlen (pattern), syntax, preg); data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4893:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen (string); data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4972: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). msg_size = strlen (msg) + 1; /* Includes the null. */ data/hyphy-2.5.23+dfsg/src/contrib/regex.cpp:4976:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (errbuf, msg, errbuf_size - 1); data/hyphy-2.5.23+dfsg/src/core/alignment.cpp:645:33: [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 unsigned long r_len = strlen( r_str ), data/hyphy-2.5.23+dfsg/src/core/alignment.cpp:646:33: [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). q_len = strlen( q_str ), data/hyphy-2.5.23+dfsg/src/core/batchlan.cpp:322:7: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (100); data/hyphy-2.5.23+dfsg/src/core/dataset.cpp:1911:37: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). lastc = toupper(fgetc(fp)); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8440:22: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). buffer[mDim]=fgetc(theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8457:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fc = fgetc (theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8474:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fc = fgetc (theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8485:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fc = fgetc (theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8499:34: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). buffer[i] = fc = fgetc (theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8512:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fc = fgetc(theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8522:34: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). buffer[i] = fc = fgetc (theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8531:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fc = fgetc(theSource); data/hyphy-2.5.23+dfsg/src/core/matrix.cpp:8539:34: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). buffer[i] = fc = fgetc (theSource); data/hyphy-2.5.23+dfsg/src/core/string_buffer.cpp:232: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). this->PushCharBuffer(str, strlen(str)); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:224: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). AllocateAndCopyString (c_string, strlen(c_string)); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:229:31: [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). unsigned long allocated = wcslen (wc_string); data/hyphy-2.5.23+dfsg/src/core/strings.cpp:1207: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). int count = strlen (open_chars); data/hyphy-2.5.23+dfsg/src/core/topology.cpp:241: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). long c = strlen (accept); data/hyphy-2.5.23+dfsg/src/utils/hyphyunixutils.cpp:168:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((readAChar = getc(stdin)) != '\n') { ANALYSIS SUMMARY: Hits = 204 Lines analyzed = 116571 in approximately 2.82 seconds (41404 lines/second) Physical Source Lines of Code (SLOC) = 76222 Hits@level = [0] 508 [1] 25 [2] 155 [3] 5 [4] 19 [5] 0 Hits@level+ = [0+] 712 [1+] 204 [2+] 179 [3+] 24 [4+] 19 [5+] 0 Hits/KSLOC@level+ = [0+] 9.34114 [1+] 2.67639 [2+] 2.3484 [3+] 0.31487 [4+] 0.249272 [5+] 0 Dot directories skipped = 2 (--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.