Open H4niz opened 5 years ago
This could be fixed by snprintf
, like:
snprintf(name, sizeof(name), "%s.pac", prefix);
In other function, that use the same input with [bns_fasta2bntseq] function, [bns_dump] function in btnseq.c. There is a buffer overflow here.
void bns_dump(const bntseq_t *bns, const char *prefix)
{
char str[1024];
FILE *fp;
int i;
{ // dump .ann
strcpy(str, prefix); strcat(str, ".ann");
(......)
{ // dump .amb
strcpy(str, prefix); strcat(str, ".amb");
(....)
}
The buffer overflow occur in str
buffer. They can be fixed by snprintf
, like @yanlinlin82 recommendation.
CVE-2019-11371 was assigned for this issue.
Any update?
I found a buffer overflow in [bns_fasta2bntseq] function.
The name buffer has only 1024 bytes, in order that buffer overflow occurs if we pass more than 1024 bytes as prefix. It's a vulnerability