EddyRivasLab / easel

Sequence analysis library used by Eddy/Rivas lab code
Other
46 stars 26 forks source link

Intermittent crash during Stockholm MSA Read (with possible fix) #56

Closed andycowie closed 3 years ago

andycowie commented 3 years ago

Reading Stockholm MSA for hmmbuild fails intermittently (around 1%-4% failure rate) when reading a Stockholm file with an empty description field like this:

# STOCKHOLM 1.0

#=GS query DE 

It fails with a heap-buffer-overflow from a strlen call here.

This seems to be fixed by changing esl_msa.c line 1252 to use memstrdup for a zero length string, changing n > 0 to n >= 0, like this:

if (n >= 0) status = esl_memstrdup(s,  n, &(msa->sqdesc[idx])); 
cryptogenomicon commented 3 years ago

Indeed. Thank you. Your fix is correct.

I've fixed that (and analogous bugs in some related functions in the same file) in the dev code, and the fix will appear in the next HMMER and Infernal releases.

andycowie commented 3 years ago

Thanks, that's great.