Skip to content

Commit

Permalink
When loading a read from sqStore, ensure that even length 0 sequences…
Browse files Browse the repository at this point in the history
… are NUL terminated.
  • Loading branch information
brianwalenz committed Sep 5, 2020
1 parent 7cc2c71 commit a64faeb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stores/sqReadData.C
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ sqRead::sqRead_decodeBlob(void) {
resizeArray(_rawBases, 0, _rawBasesAlloc, rawLength+1, resizeArray_doNothing);
resizeArray(_corBases, 0, _corBasesAlloc, corLength+1, resizeArray_doNothing);

_rawBases[0] = 0; // We don't need to clear the whole string, but clearing the first byte
_corBases[0] = 0; // will leave strings that don't decode() below correctly terminated.

// Forget what sequence we previously returned to the user.

_retFlags = 0;
Expand Down

0 comments on commit a64faeb

Please sign in to comment.