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/kalign-3.3/src/align_io.c Examining data/kalign-3.3/src/align_io.h Examining data/kalign-3.3/src/alignment.h Examining data/kalign-3.3/src/alignment_parameters.c Examining data/kalign-3.3/src/alignment_parameters.h Examining data/kalign-3.3/src/aln_controller.c Examining data/kalign-3.3/src/aln_controller.h Examining data/kalign-3.3/src/aln_mem.c Examining data/kalign-3.3/src/aln_mem.h Examining data/kalign-3.3/src/aln_profileprofile.c Examining data/kalign-3.3/src/aln_profileprofile.h Examining data/kalign-3.3/src/aln_run.c Examining data/kalign-3.3/src/aln_run.h Examining data/kalign-3.3/src/aln_seqprofile.c Examining data/kalign-3.3/src/aln_seqprofile.h Examining data/kalign-3.3/src/aln_seqseq.c Examining data/kalign-3.3/src/aln_seqseq.h Examining data/kalign-3.3/src/aln_setup.c Examining data/kalign-3.3/src/aln_setup.h Examining data/kalign-3.3/src/aln_struct.h Examining data/kalign-3.3/src/aln_task.c Examining data/kalign-3.3/src/aln_task.h Examining data/kalign-3.3/src/alphabet.c Examining data/kalign-3.3/src/alphabet.h Examining data/kalign-3.3/src/benchrunner.c Examining data/kalign-3.3/src/bisectingKmeans.h Examining data/kalign-3.3/src/bpm.h Examining data/kalign-3.3/src/create_run_cmds.c Examining data/kalign-3.3/src/create_run_kalign_diff_cmds.c Examining data/kalign-3.3/src/esl_stopwatch.c Examining data/kalign-3.3/src/esl_stopwatch.h Examining data/kalign-3.3/src/estimate_aln_param.c Examining data/kalign-3.3/src/estimate_aln_param.h Examining data/kalign-3.3/src/euclidean_dist.h Examining data/kalign-3.3/src/global.h Examining data/kalign-3.3/src/idata.c Examining data/kalign-3.3/src/idata.h Examining data/kalign-3.3/src/kchaos.c Examining data/kalign-3.3/src/kmeans.c Examining data/kalign-3.3/src/kmeans.h Examining data/kalign-3.3/src/misc.h Examining data/kalign-3.3/src/msa.h Examining data/kalign-3.3/src/old_aln_data.c Examining data/kalign-3.3/src/old_aln_data.h Examining data/kalign-3.3/src/parameters.c Examining data/kalign-3.3/src/parameters.h Examining data/kalign-3.3/src/pick_anchor.c Examining data/kalign-3.3/src/pick_anchor.h Examining data/kalign-3.3/src/queue.c Examining data/kalign-3.3/src/queue.h Examining data/kalign-3.3/src/read_from_stdin_test.c Examining data/kalign-3.3/src/run_get_param.c Examining data/kalign-3.3/src/run_kalign.c Examining data/kalign-3.3/src/rwalign.c Examining data/kalign-3.3/src/sequence_distance.h Examining data/kalign-3.3/src/time_and_score_aln.c Examining data/kalign-3.3/src/tldevel.c Examining data/kalign-3.3/src/tldevel.h Examining data/kalign-3.3/src/tlmisc.c Examining data/kalign-3.3/src/tlmisc.h Examining data/kalign-3.3/src/tlrng.c Examining data/kalign-3.3/src/tlrng.h Examining data/kalign-3.3/src/weave_alignment.c Examining data/kalign-3.3/src/weave_alignment.h Examining data/kalign-3.3/src/alignment.c Examining data/kalign-3.3/src/bisectingKmeans.c Examining data/kalign-3.3/src/bpm.c Examining data/kalign-3.3/src/euclidean_dist.c Examining data/kalign-3.3/src/misc.c Examining data/kalign-3.3/src/sequence_distance.c FINAL RESULTS: data/kalign-3.3/src/benchrunner.c:262:21: [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. if (system("which kalign")){ data/kalign-3.3/src/benchrunner.c:269:21: [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. if (system("which kalign2")){ data/kalign-3.3/src/benchrunner.c:275:21: [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. if (system("which muscle3.8.31_i86linux32")){ data/kalign-3.3/src/benchrunner.c:280:21: [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. if (system("which clustalo-1.2.4-Ubuntu-x86_64")){ data/kalign-3.3/src/benchrunner.c:295:21: [4] (shell) popen: 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. RUNP(pipe = popen(cmd,"r")); data/kalign-3.3/src/benchrunner.c:334:29: [4] (shell) popen: 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. RUNP(pipe = popen(cmd,"r")); data/kalign-3.3/src/create_run_cmds.c:40:21: [4] (shell) popen: 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. RUNP(pipe = popen(cmd,"r")); data/kalign-3.3/src/create_run_kalign_diff_cmds.c:151:21: [4] (shell) popen: 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. RUNP(pipe = popen(cmd,"r")); data/kalign-3.3/src/time_and_score_aln.c:199:21: [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. if (system("which kalign")){ data/kalign-3.3/src/time_and_score_aln.c:205:21: [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. if (system("which kalign2")){ data/kalign-3.3/src/time_and_score_aln.c:211:21: [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. if (system("which muscle3.8.31_i86linux32")){ data/kalign-3.3/src/time_and_score_aln.c:216:21: [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. if (system("which clustalo-1.2.4-Ubuntu-x86_64")){ data/kalign-3.3/src/time_and_score_aln.c:231:21: [4] (shell) popen: 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. RUNP(pipe = popen(cmd,"r")); data/kalign-3.3/src/time_and_score_aln.c:322:29: [4] (shell) popen: 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. RUNP(pipe = popen(cmd,"r")); data/kalign-3.3/src/tldevel.c:305:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(f_ptr, format, argp); data/kalign-3.3/src/tldevel.c:319:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(f_ptr, format, argp); data/kalign-3.3/src/tldevel.c:334:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(f_ptr, format, argp); data/kalign-3.3/src/benchrunner.c:228:26: [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 *envpaths = getenv("PATH"); data/kalign-3.3/src/benchrunner.c:230:16: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. path = realpath(param->scratch, NULL); data/kalign-3.3/src/run_kalign.c:390:27: [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. datadir = getenv("testdatafiledir"); data/kalign-3.3/src/rwalign.c:125: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. datadir = getenv("testdatafiledir"); data/kalign-3.3/src/time_and_score_aln.c:186:26: [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 *envpaths = getenv("PATH"); data/kalign-3.3/src/time_and_score_aln.c:188:16: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. path = realpath(scratch, NULL); data/kalign-3.3/src/align_io.c:400:30: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(file = fopen( infile, "r" ))){ data/kalign-3.3/src/align_io.c:859: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 tmp[10]; data/kalign-3.3/src/align_io.c:896: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). n->start = atoi(tmp); data/kalign-3.3/src/align_io.c:904:26: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). n->end = atoi(tmp); data/kalign-3.3/src/align_io.c:2207:29: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fout = fopen(outfile, "w")) == NULL){ data/kalign-3.3/src/align_io.c:2327:29: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fout = fopen(outfile, "w")) == NULL){ data/kalign-3.3/src/align_io.c:2478:29: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fout = fopen(outfile, "w")) == NULL){ data/kalign-3.3/src/align_io.c:2619:29: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fout = fopen(outfile, "w")) == NULL){ data/kalign-3.3/src/align_io.c:2791:29: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fout = fopen(outfile, "w")) == NULL){ data/kalign-3.3/src/alignment.c:1399: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). s[j].ga = MAX(s[j-1].ga-ext,s[j-1].a-open); data/kalign-3.3/src/alignment.c:1438: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). pa = MAX3(pa,pga -open,pgb + prof1[-37]); data/kalign-3.3/src/alignment.c:1448: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). s[j].ga = MAX(xga-ext,xa-open); data/kalign-3.3/src/alignment.c:1462:35: [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). pa = MAX3(pa,pga -open,pgb + prof1[-37]); data/kalign-3.3/src/alignment.c:1510: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). s[j].ga = MAX(s[j+1].ga-ext,s[j+1].a-open); data/kalign-3.3/src/alignment.c:1547:44: [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). pa = MAX3(pa,pga - open,pgb +prof1[91]); data/kalign-3.3/src/alignment.c:1555: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). s[j].ga = MAX(xga-ext,xa-open); data/kalign-3.3/src/alignment.c:1569:36: [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). pa = MAX3(pa,pga - open,pgb +prof1[91]); data/kalign-3.3/src/aln_seqprofile.c:46: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). s[j].ga = MAX(s[j-1].ga-ext,s[j-1].a-open); data/kalign-3.3/src/aln_seqprofile.c:85: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). pa = MAX3(pa,pga -open,pgb + prof1[-37]); data/kalign-3.3/src/aln_seqprofile.c:95: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). s[j].ga = MAX(xga-ext,xa-open); data/kalign-3.3/src/aln_seqprofile.c:109:35: [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). pa = MAX3(pa,pga -open,pgb + prof1[-37]); data/kalign-3.3/src/aln_seqprofile.c:160: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). s[j].ga = MAX(s[j+1].ga-ext,s[j+1].a-open); data/kalign-3.3/src/aln_seqprofile.c:197:44: [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). pa = MAX3(pa,pga - open,pgb +prof1[91]); data/kalign-3.3/src/aln_seqprofile.c:205: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). s[j].ga = MAX(xga-ext,xa-open); data/kalign-3.3/src/aln_seqprofile.c:219:36: [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). pa = MAX3(pa,pga - open,pgb +prof1[91]); data/kalign-3.3/src/alphabet.c:154: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 aacode[20] = "ACDEFGHIKLMNPQRSTVWY"; data/kalign-3.3/src/alphabet.c:187: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 aacode[23] = "ARNDCQEGHILKMFPSTWYVBZX"; data/kalign-3.3/src/alphabet.c:215: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 dnacode[16] = "ACGTUNRYSWKMBDHV"; data/kalign-3.3/src/alphabet.c:256: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 aacode[20] = "ACDEFGHIKLMNPQRSTVWY"; data/kalign-3.3/src/benchrunner.c:108: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). param->uniq = atoi(optarg); data/kalign-3.3/src/benchrunner.c:214: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 cmd[BUFSIZ*2]; data/kalign-3.3/src/benchrunner.c:215: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 ret[BUFSIZ]; data/kalign-3.3/src/benchrunner.c:216: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 progline[BUFSIZ]; data/kalign-3.3/src/benchrunner.c:367:48: [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). RUNP(out_ptr = fopen(param->output ,"w")); data/kalign-3.3/src/benchrunner.c:398:48: [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). RUNP(out_ptr = fopen(param->output,"a")); data/kalign-3.3/src/create_run_cmds.c:14: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 cmd[BUFSIZ]; data/kalign-3.3/src/create_run_cmds.c:15: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 ret[BUFSIZ]; data/kalign-3.3/src/create_run_cmds.c:16: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 out[BUFSIZ]; data/kalign-3.3/src/create_run_kalign_diff_cmds.c:43: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 cmd[BUFSIZ]; data/kalign-3.3/src/create_run_kalign_diff_cmds.c:44: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 ret[BUFSIZ]; data/kalign-3.3/src/create_run_kalign_diff_cmds.c:45: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 out[BUFSIZ]; data/kalign-3.3/src/create_run_kalign_diff_cmds.c:46: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 filename[512]; data/kalign-3.3/src/create_run_kalign_diff_cmds.c:47: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 runname[512]; data/kalign-3.3/src/create_run_kalign_diff_cmds.c:240: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). RUNP(pipe = fopen(cmd, "w")); data/kalign-3.3/src/esl_stopwatch.c:161:17: [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(buf, "%02d:%02d:%02d.%02d", h,m,s,hs); data/kalign-3.3/src/esl_stopwatch.c:163:17: [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(buf, "%02d:%02d:%02d", h,m,s); data/kalign-3.3/src/esl_stopwatch.c:191: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[128]; /* (safely holds up to 10^14 years; I'll be dead by then) */ data/kalign-3.3/src/esl_stopwatch.c:224: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[128]; /* (safely holds up to 10^14 years; even I'll be dead by then) */ data/kalign-3.3/src/esl_stopwatch.c:225: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 buf2[128]; /* (safely holds up to 10^14 years; even I'll be dead by then) */ data/kalign-3.3/src/run_get_param.c:616: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). RUNP( f_ptr = fopen(out, "w")); data/kalign-3.3/src/run_kalign.c:234: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). param->chaos = atoi(optarg); data/kalign-3.3/src/run_kalign.c:246: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). param->param_set = atoi(optarg); data/kalign-3.3/src/run_kalign.c:255: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). param->nthreads = atoi(optarg); data/kalign-3.3/src/rwalign.c:119: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[BUFFER_LEN]; data/kalign-3.3/src/rwalign.c:697:30: [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). RUNP(f_ptr = fopen(outfile, "w")); data/kalign-3.3/src/rwalign.c:748: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 date[64]; /* today's date in GCG's format "October 3, 1996 15:57" */ data/kalign-3.3/src/rwalign.c:769:30: [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). RUNP(f_ptr = fopen(outfile, "w")); data/kalign-3.3/src/rwalign.c:1048:30: [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). RUNP(f_ptr = fopen(outfile, "w")); data/kalign-3.3/src/rwalign.c:1812:30: [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). RUNP(f_ptr = fopen(infile, "r")); data/kalign-3.3/src/time_and_score_aln.c:174: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 cmd[BUFFER_LEN*2]; data/kalign-3.3/src/time_and_score_aln.c:175: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 ret[BUFFER_LEN]; data/kalign-3.3/src/time_and_score_aln.c:336:40: [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). RUNP(out_ptr = fopen(out_file_name,"w")); data/kalign-3.3/src/time_and_score_aln.c:339:40: [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). RUNP(out_ptr = fopen(out_file_name,"a")); data/kalign-3.3/src/tldevel.c:299: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 time_string[200]; data/kalign-3.3/src/tldevel.c:312: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 time_string[200]; data/kalign-3.3/src/tldevel.c:327: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 time_string[200]; data/kalign-3.3/src/align_io.c:373: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). nbytes = strlen(string); data/kalign-3.3/src/align_io.c:429:37: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(stdin); data/kalign-3.3/src/align_io.c:1535: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). nbytes = strlen(string); data/kalign-3.3/src/align_io.c:1664: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). nbytes = strlen(string); data/kalign-3.3/src/align_io.c:2925: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). for(i = 0 ; i < strlen(DNA_letters);i++){ data/kalign-3.3/src/align_io.c:2929: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). for(i = 0 ; i < strlen(protein_letters);i++){ data/kalign-3.3/src/benchrunner.c:240: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). l = strlen(param->options[0]); data/kalign-3.3/src/benchrunner.c:346: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). l = strlen(options); data/kalign-3.3/src/bpm.c:92: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). len = strlen(seq); data/kalign-3.3/src/bpm.c:134: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). len = strlen(seq); data/kalign-3.3/src/bpm.c:162: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). len = strlen(seq); data/kalign-3.3/src/create_run_kalign_diff_cmds.c:131: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). l = strlen(param->inputdir); data/kalign-3.3/src/create_run_kalign_diff_cmds.c:160: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). l = strlen(filename); data/kalign-3.3/src/misc.c:70: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). len = strlen(seq); data/kalign-3.3/src/misc.c:109: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). int m = strlen(pattern); data/kalign-3.3/src/misc.c:110: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). int n = strlen (text); data/kalign-3.3/src/misc.c:139: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). int m = strlen(pattern); data/kalign-3.3/src/misc.c:140: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). int n = strlen (text); data/kalign-3.3/src/misc.c:174: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). int m = strlen(pattern); data/kalign-3.3/src/misc.c:175: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). int n = strlen(text); data/kalign-3.3/src/rwalign.c:401:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = 0 ; i < (int)strlen(DNA_letters);i++){ data/kalign-3.3/src/rwalign.c:405:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for(i = 0 ; i < (int)strlen(protein_letters);i++){ data/kalign-3.3/src/tlmisc.c:39: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). len = (int) strlen(path); data/kalign-3.3/src/tlmisc.c:72: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). len = (int) strlen(path); data/kalign-3.3/src/tlmisc.c:112: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). for(j = 0; j < (int) strlen(argv[i]);j++){ ANALYSIS SUMMARY: Hits = 114 Lines analyzed = 20910 in approximately 0.56 seconds (37162 lines/second) Physical Source Lines of Code (SLOC) = 14565 Hits@level = [0] 329 [1] 25 [2] 66 [3] 6 [4] 17 [5] 0 Hits@level+ = [0+] 443 [1+] 114 [2+] 89 [3+] 23 [4+] 17 [5+] 0 Hits/KSLOC@level+ = [0+] 30.4154 [1+] 7.82698 [2+] 6.11054 [3+] 1.57913 [4+] 1.16718 [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.