This PR fixes an uninitialized pointer in the ESL_SQ struct initializer. Since the sq->abc was not set to NULL here, there was a risk that this field would contain garbage later on. I discovered this when calling esl_sq_Compare on two sequences in text mode: I would get a segmentation fault since the abc pointer would not be NULL (because of some garbage in the allocated memory) and it would then try to compare the alphabets, interpreting the garbage as pointers.
A bit of context (and a shameless plug): I discovered this while writing pyhmmer, a Cython extension module that provides Python bindings to HMMER and Easel (it's on GitHub and on PyPI).
Hi!
This PR fixes an uninitialized pointer in the
ESL_SQ
struct initializer. Since thesq->abc
was not set to NULL here, there was a risk that this field would contain garbage later on. I discovered this when callingesl_sq_Compare
on two sequences in text mode: I would get a segmentation fault since theabc
pointer would not beNULL
(because of some garbage in the allocated memory) and it would then try to compare the alphabets, interpreting the garbage as pointers.A bit of context (and a shameless plug): I discovered this while writing
pyhmmer
, a Cython extension module that provides Python bindings to HMMER and Easel (it's on GitHub and on PyPI).