Skip to content

Commit

Permalink
fix(query): off-by-one bug in read size check after read (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
dakimura authored Oct 3, 2021
1 parent 038ab37 commit 5211168
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion executor/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func (ex *ioExec) readBackward(finalBuffer []byte, fp *ioFilePlan,
// Copy the found data into the final buffer in reverse order
if numRead != 0 {
bytesRead += numRead
if numRead <= bytesToRead {
if numRead < bytesToRead {
bytesToRead -= numRead
copy(finalBuffer[bytesToRead:], fileBuffer)
} else {
Expand Down

0 comments on commit 5211168

Please sign in to comment.