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/gubbins-2.4.1/src/Newickform.c
Examining data/gubbins-2.4.1/src/Newickform.h
Examining data/gubbins-2.4.1/src/PyGubbins.cpp
Examining data/gubbins-2.4.1/src/alignment_file.h
Examining data/gubbins-2.4.1/src/block_tab_file.c
Examining data/gubbins-2.4.1/src/block_tab_file.h
Examining data/gubbins-2.4.1/src/branch_sequences.c
Examining data/gubbins-2.4.1/src/branch_sequences.h
Examining data/gubbins-2.4.1/src/fasta_of_snp_sites.c
Examining data/gubbins-2.4.1/src/fasta_of_snp_sites.h
Examining data/gubbins-2.4.1/src/gff_file.c
Examining data/gubbins-2.4.1/src/gff_file.h
Examining data/gubbins-2.4.1/src/gubbins.c
Examining data/gubbins-2.4.1/src/gubbins.h
Examining data/gubbins-2.4.1/src/kseq.h
Examining data/gubbins-2.4.1/src/parse_phylip.c
Examining data/gubbins-2.4.1/src/parse_phylip.h
Examining data/gubbins-2.4.1/src/parse_vcf.c
Examining data/gubbins-2.4.1/src/parse_vcf.h
Examining data/gubbins-2.4.1/src/phylip_of_snp_sites.c
Examining data/gubbins-2.4.1/src/phylip_of_snp_sites.h
Examining data/gubbins-2.4.1/src/seqUtil.c
Examining data/gubbins-2.4.1/src/seqUtil.h
Examining data/gubbins-2.4.1/src/snp_searching.c
Examining data/gubbins-2.4.1/src/snp_searching.h
Examining data/gubbins-2.4.1/src/snp_sites.c
Examining data/gubbins-2.4.1/src/snp_sites.h
Examining data/gubbins-2.4.1/src/string_cat.c
Examining data/gubbins-2.4.1/src/string_cat.h
Examining data/gubbins-2.4.1/src/tree_scaling.c
Examining data/gubbins-2.4.1/src/tree_scaling.h
Examining data/gubbins-2.4.1/src/tree_statistics.c
Examining data/gubbins-2.4.1/src/tree_statistics.h
Examining data/gubbins-2.4.1/src/vcf.c
Examining data/gubbins-2.4.1/src/vcf.h
Examining data/gubbins-2.4.1/src/alignment_file.c
Examining data/gubbins-2.4.1/src/main.c
Examining data/gubbins-2.4.1/tests/check_branch_sequences.c
Examining data/gubbins-2.4.1/tests/check_branch_sequences.h
Examining data/gubbins-2.4.1/tests/check_gubbins.c
Examining data/gubbins-2.4.1/tests/check_gubbins.h
Examining data/gubbins-2.4.1/tests/check_parse_phylip.c
Examining data/gubbins-2.4.1/tests/check_parse_phylip.h
Examining data/gubbins-2.4.1/tests/check_snp_searching.c
Examining data/gubbins-2.4.1/tests/check_snp_searching.h
Examining data/gubbins-2.4.1/tests/check_snp_sites.c
Examining data/gubbins-2.4.1/tests/check_snp_sites.h
Examining data/gubbins-2.4.1/tests/check_vcf_parsing.c
Examining data/gubbins-2.4.1/tests/check_vcf_parsing.h
Examining data/gubbins-2.4.1/tests/helper_methods.c
Examining data/gubbins-2.4.1/tests/helper_methods.h
Examining data/gubbins-2.4.1/tests/run_all_tests.c

FINAL RESULTS:

data/gubbins-2.4.1/src/alignment_file.c:103:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if( access( filename, F_OK ) == -1 ) {
data/gubbins-2.4.1/src/main.c:59:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  if( access( filename, F_OK ) != -1 ) {
data/gubbins-2.4.1/src/seqUtil.c:124:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
		strcat(temp, input);
data/gubbins-2.4.1/src/main.c:100:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt_long (argc, argv, "hrv:f:t:m:a:b:",
data/gubbins-2.4.1/src/Newickform.c:37: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 acStrArray[256];
data/gubbins-2.4.1/src/Newickform.c:52:6:  [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(pcInputFile, "r+");
data/gubbins-2.4.1/src/Newickform.c:75: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 block_file_name[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/Newickform.c:76: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 block_file_extension[5]= {".tab"};
data/gubbins-2.4.1/src/Newickform.c:77:2:  [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(block_file_name, filename, size_of_string(filename) +1);
data/gubbins-2.4.1/src/Newickform.c:79: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).
	block_file_pointer = fopen(block_file_name, "w");
data/gubbins-2.4.1/src/Newickform.c:83: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 branch_snps_file_name[MAX_FILENAME_SIZE]= {""};
data/gubbins-2.4.1/src/Newickform.c:84: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 branchtab_extension[18]= {".branch_snps.tab"};
data/gubbins-2.4.1/src/Newickform.c:85:2:  [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(branch_snps_file_name, filename, size_of_string(filename) +1);
data/gubbins-2.4.1/src/Newickform.c:87: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).
	branch_snps_file_pointer = fopen(branch_snps_file_name, "w");
data/gubbins-2.4.1/src/Newickform.c:91: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 gff_file_name[MAX_FILENAME_SIZE]= {""};
data/gubbins-2.4.1/src/Newickform.c:92:3:  [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(gff_file_name, filename, size_of_string(filename) +1);
data/gubbins-2.4.1/src/Newickform.c:93: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 gff_extension[5]= {".gff"};
data/gubbins-2.4.1/src/Newickform.c:95: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).
	gff_file_pointer = fopen(gff_file_name, "w");
data/gubbins-2.4.1/src/Newickform.c:116: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 cleaned_taxon[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/Newickform.c:127:2:  [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(taxon, cleaned_taxon, size_of_string(cleaned_taxon) +1);
data/gubbins-2.4.1/src/Newickform.c:160:4:  [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(node->taxon, pcStart, strlen(pcStart));
data/gubbins-2.4.1/src/Newickform.c:167:4:  [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(node->taxon, pcStart, strlen(pcStart));
data/gubbins-2.4.1/src/Newickform.c:303:4:  [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(node->taxon, pcStart, strlen(pcStart));
data/gubbins-2.4.1/src/alignment_file.c:38: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 szBuffer[MAX_READ_BUFFER] = {0};  
data/gubbins-2.4.1/src/alignment_file.c:238:4:  [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 current_line_buffer[MAX_READ_BUFFER] = {0};
data/gubbins-2.4.1/src/alignment_file.c:273:3:  [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(sequence_names[i], seq->name.s, size_of_string(seq->name.s)+1);
data/gubbins-2.4.1/src/alignment_file.c:285: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  input_chars[10];
data/gubbins-2.4.1/src/branch_sequences.c:281:3:  [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(root->taxon_names, root->taxon, size_of_string(root->taxon)+1);
data/gubbins-2.4.1/src/branch_sequences.c:293: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 * child_sequences[root->childNum];
data/gubbins-2.4.1/src/branch_sequences.c:305:4:  [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 delimiter_string[3] = {" "};
data/gubbins-2.4.1/src/fasta_of_snp_sites.c:37:2:  [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(base_filename, filename, 1024*sizeof(char));
data/gubbins-2.4.1/src/fasta_of_snp_sites.c:38: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 extension[16] = {".snp_sites.aln"};
data/gubbins-2.4.1/src/fasta_of_snp_sites.c:40: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).
	fasta_file_pointer = fopen(base_filename, "w");
data/gubbins-2.4.1/src/gubbins.c:55:19:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	vcf_file_pointer=fopen(vcf_filename, "r");
data/gubbins-2.4.1/src/gubbins.c:85: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 * sample_names[number_of_samples];
data/gubbins-2.4.1/src/gubbins.c:112: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).
	output_tree_pointer=fopen(tree_filename, "w");
data/gubbins-2.4.1/src/kseq.h:125:4:  [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(str->s + str->l, ks->buf + ks->begin, i - ks->begin); \
data/gubbins-2.4.1/src/main.c:71: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 multi_fasta_filename[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/main.c:72: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 vcf_filename[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/main.c:73: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 tree_filename[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/main.c:74: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 phylip_filename[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/main.c:75: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 original_multi_fasta_filename[MAX_FILENAME_SIZE] = {""};
data/gubbins-2.4.1/src/main.c:123:6:  [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(original_multi_fasta_filename, optarg, size_of_string(optarg) +1);
data/gubbins-2.4.1/src/main.c:126:8:  [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(vcf_filename, optarg, size_of_string(optarg) +1);
data/gubbins-2.4.1/src/main.c:129:23:  [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).
	          min_snps = atoi(optarg);
data/gubbins-2.4.1/src/main.c:132:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  	          window_min = atoi(optarg);
data/gubbins-2.4.1/src/main.c:135:24:  [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).
	  	      window_max = atoi(optarg);
data/gubbins-2.4.1/src/main.c:138:12:  [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(tree_filename, optarg, size_of_string(optarg) +1);
data/gubbins-2.4.1/src/main.c:151:4:  [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(multi_fasta_filename, argv[optind], size_of_string(argv[optind]) +1);
data/gubbins-2.4.1/src/parse_phylip.c:72:2:  [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(sequence_bases, sequences[sequence_index], size_of_string(sequences[sequence_index]) +1);
data/gubbins-2.4.1/src/parse_phylip.c:200:3:  [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(sample_names[i], phylip_sample_names[i], size_of_string(phylip_sample_names[i]) +1);
data/gubbins-2.4.1/src/parse_phylip.c:351:3:  [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(sample_statistics_placeholder->sample_name, phylip_sample_names[i], size_of_string(phylip_sample_names[i]) +1);
data/gubbins-2.4.1/src/parse_vcf.c:38: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 result[1000] = {0};  
data/gubbins-2.4.1/src/parse_vcf.c:53:38:  [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).
			integer_values[reference_index] = atoi(result);
data/gubbins-2.4.1/src/parse_vcf.c:68: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 result[1000] = {0};  
data/gubbins-2.4.1/src/parse_vcf.c:131: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 szBuffer[2] = {0};  
data/gubbins-2.4.1/src/parse_vcf.c:151: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 result[100] = {0};
data/gubbins-2.4.1/src/parse_vcf.c:172: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 result[100] = {0};
data/gubbins-2.4.1/src/parse_vcf.c:206: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 result[100] = {0};  
data/gubbins-2.4.1/src/parse_vcf.c:226: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(column_names[i], result, (strlen(result)+1)*sizeof(char));
data/gubbins-2.4.1/src/phylip_of_snp_sites.c:37:2:  [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(base_filename, filename, 1024*sizeof(char));
data/gubbins-2.4.1/src/phylip_of_snp_sites.c:38: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 extension[8] = {".phylip"};
data/gubbins-2.4.1/src/phylip_of_snp_sites.c:40: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).
	fasta_file_pointer = fopen(base_filename, "w");
data/gubbins-2.4.1/src/seqUtil.c:119:3:  [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, input, inputLen);
data/gubbins-2.4.1/src/seqUtil.c:123:3:  [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, *ppcStr, *iLen);
data/gubbins-2.4.1/src/snp_sites.c:97: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 filename_without_directory[MAX_FILENAME_SIZE];
data/gubbins-2.4.1/src/string_cat.c:33:2:  [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(input_string + input_str_size, string_to_concat, (to_concat_str_size+1)*sizeof(char));
data/gubbins-2.4.1/src/tree_statistics.c:34:2:  [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(base_filename, filename, (1024)*sizeof(char));
data/gubbins-2.4.1/src/tree_statistics.c:35: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 extension[7] = {".stats"};
data/gubbins-2.4.1/src/tree_statistics.c:37: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).
	file_pointer = fopen(base_filename, "w");
data/gubbins-2.4.1/src/vcf.c:37:2:  [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(base_filename, filename, (1024+1)*sizeof(char));
data/gubbins-2.4.1/src/vcf.c:38: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 extension[5] = {".vcf"};
data/gubbins-2.4.1/src/vcf.c:40:19:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	vcf_file_pointer=fopen(base_filename, "w");
data/gubbins-2.4.1/src/vcf.c:80: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 alt_bases[30];
data/gubbins-2.4.1/tests/check_parse_phylip.c:19: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 *sample_names[3];
data/gubbins-2.4.1/tests/check_parse_phylip.c:26: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 *filtered_bases_for_snps[3];
data/gubbins-2.4.1/tests/check_parse_phylip.c:41: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 sequence_bases[10];
data/gubbins-2.4.1/tests/check_parse_phylip.c:66: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 sequence_bases[10];
data/gubbins-2.4.1/tests/check_parse_phylip.c:77: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 sequence_bases[10];
data/gubbins-2.4.1/tests/check_snp_sites.c:119: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 actual_reference_sequence[2001];
data/gubbins-2.4.1/tests/check_snp_sites.c:128: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 actual_reference_sequence[2001];
data/gubbins-2.4.1/tests/check_snp_sites.c:136: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 actual_reference_sequence[2001];
data/gubbins-2.4.1/tests/check_snp_sites.c:144: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 actual_reference_sequence[9];
data/gubbins-2.4.1/tests/check_snp_sites.c:173: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 output_filename[30];
data/gubbins-2.4.1/tests/check_snp_sites.c:182: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 output_filename[30];
data/gubbins-2.4.1/tests/helper_methods.c:20: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).
  expected_output_fh = fopen(expected_output_filename, "r");
data/gubbins-2.4.1/tests/helper_methods.c:21: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).
  actual_output_fh = fopen(actual_output_filename, "r");
data/gubbins-2.4.1/tests/helper_methods.c:52:15:  [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 *file = fopen(fileName, "r");
data/gubbins-2.4.1/tests/helper_methods.c:86: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[4096];
data/gubbins-2.4.1/tests/helper_methods.c:90:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd_from = open(from, O_RDONLY);
data/gubbins-2.4.1/tests/helper_methods.c:94: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).
    fd_to = open(to, O_WRONLY | O_CREAT | O_EXCL, 0666);
data/gubbins-2.4.1/src/Newickform.c:159: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).
			node->taxon = (char*)seqMalloc(strlen(pcStart) + 1);
data/gubbins-2.4.1/src/Newickform.c:160: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).
			memcpy(node->taxon, pcStart, strlen(pcStart));
data/gubbins-2.4.1/src/Newickform.c:166: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).
			node->taxon = (char*)seqMalloc(strlen(pcStart) + 1);
data/gubbins-2.4.1/src/Newickform.c:167: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).
			memcpy(node->taxon, pcStart, strlen(pcStart));
data/gubbins-2.4.1/src/Newickform.c:302:28:  [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).
			node->taxon = seqMalloc(strlen(pcStart) + 1);
data/gubbins-2.4.1/src/Newickform.c:303: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).
			memcpy(node->taxon, pcStart, strlen(pcStart));
data/gubbins-2.4.1/src/alignment_file.c:44:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		length_of_line = strlen(szBuffer) - 1;
data/gubbins-2.4.1/src/parse_vcf.c:226: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).
				memcpy(column_names[i], result, (strlen(result)+1)*sizeof(char));
data/gubbins-2.4.1/src/string_cat.c:26:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  return strlen(input_string);
data/gubbins-2.4.1/tests/helper_methods.c:54:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ( (ch = fgetc(file)) != EOF )
data/gubbins-2.4.1/tests/helper_methods.c:98:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (nread = read(fd_from, buf, sizeof buf), nread > 0)

ANALYSIS SUMMARY:

Hits = 102
Lines analyzed = 6313 in approximately 0.26 seconds (24292 lines/second)
Physical Source Lines of Code (SLOC) = 4403
Hits@level = [0]  82 [1]  11 [2]  87 [3]   1 [4]   3 [5]   0
Hits@level+ = [0+] 184 [1+] 102 [2+]  91 [3+]   4 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 41.7897 [1+] 23.166 [2+] 20.6677 [3+] 0.908471 [4+] 0.681354 [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.