Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/ffindex/src/ffindex_from_fasta.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ int main(int argn, char **argv)
name[seq_id_length++] = *(fasta_data + fasta_offset);
}

if(seq_id_length >= FFINDEX_MAX_ENTRY_NAME_LENTH)
{
fprintf(stderr, "Error: The id of entry %d is longer than the maximum of %d characters\n", seq_id, FFINDEX_MAX_ENTRY_NAME_LENTH);
// Those files are bogus because they are half filled, so we remove them
// No error handling since abort anyway
fclose(data_file);
fclose(index_file);
remove(data_filename);
remove(index_filename);
exit(EXIT_FAILURE);
}

entry[entry_length++] = input;

fasta_offset++;
Expand Down