Menu

#42 BitpackStringDecoder::inputProcessAligned() may read too many records

None
open
None
1
2015-09-23
2015-08-25
No

The BitpackStringDecoder::inputProcessAligned() function contains the following loop:

while (currentRecordIndex_ < maxRecordCount_ && nBytesRead < nBytesAvailable) {
   ...
}
The problem is that this loop may fill beyond the capacity of destBuffer_ if the file contains more records than the buffer. Perhaps the loop condition should be changed to something like this:
while (currentRecordIndex_ < maxRecordCount_ && nBytesRead < nBytesAvailable && destBuffer_->nextIndex() < destBuffer_->capacity()) {
   ...
}

Discussion

  • Chris Lundgren

    Chris Lundgren - 2015-08-25

    here's an example file containing string data

     
  • Stan Coleby

    Stan Coleby - 2015-09-23
    • assigned_to: Stan Coleby
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB