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/pscan-chip-1.1/pscan_chip.cpp Examining data/pscan-chip-1.1/fasta_to_raw.cpp FINAL RESULTS: data/pscan-chip-1.1/pscan_chip.cpp:209:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add_argv[0], argv[0]); data/pscan-chip-1.1/pscan_chip.cpp:211:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add_argv[2], additional_matrix_backgroundfile.c_str()); data/pscan-chip-1.1/pscan_chip.cpp:213:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add_argv[4], DEFAULT_BG_GENOME.c_str()); data/pscan-chip-1.1/pscan_chip.cpp:215:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(add_argv[6], additional_matrixfile.c_str()); data/pscan-chip-1.1/fasta_to_raw.cpp:80:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). out2.open((fout.c_str())); data/pscan-chip-1.1/pscan_chip.cpp:45:1: [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 VI['T' + 1]; data/pscan-chip-1.1/pscan_chip.cpp:189:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fasta_out.open(outfile.c_str(), ios::out); data/pscan-chip-1.1/pscan_chip.cpp:204: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 *add_argv[arg_num]; data/pscan-chip-1.1/pscan_chip.cpp:210:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(add_argv[1], "-r"); data/pscan-chip-1.1/pscan_chip.cpp:212:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(add_argv[3], "-g"); data/pscan-chip-1.1/pscan_chip.cpp:214:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(add_argv[5], "-M"); data/pscan-chip-1.1/pscan_chip.cpp:457:2: [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 Oligo[M->length() + 1]; data/pscan-chip-1.1/pscan_chip.cpp:741:8: [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). out2.open(dist2_outfile.c_str()); data/pscan-chip-1.1/pscan_chip.cpp:742:8: [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). out3.open(dist3_outfile.c_str()); data/pscan-chip-1.1/pscan_chip.cpp:1174:6: [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). in.open(file.c_str()); data/pscan-chip-1.1/pscan_chip.cpp:1247:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). RSIZE = atoi(argv[++i]); data/pscan-chip-1.1/pscan_chip.cpp:474:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(Oligo, S->seq() + RSIZE/2 + (M->get_pos_at(i) - M->length()/2), M->length()); data/pscan-chip-1.1/pscan_chip.cpp:510:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(Oligo, S->seq() + RSIZE/2 + P, M->length()); data/pscan-chip-1.1/pscan_chip.cpp:522:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(Oligo, S->seq() + RSIZE/2 + P, M->length()); ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 2929 in approximately 0.08 seconds (38563 lines/second) Physical Source Lines of Code (SLOC) = 1842 Hits@level = [0] 0 [1] 3 [2] 12 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 19 [1+] 19 [2+] 16 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 10.3149 [1+] 10.3149 [2+] 8.68621 [3+] 2.17155 [4+] 2.17155 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.