Skip to content

Commit

Permalink
Merge pull request #18051 from jakesmith/HPCC-30884-blockedSizeIO-bug
Browse files Browse the repository at this point in the history
HPCC-30884 Overflow causing truncation using blockedSizeIO

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday authored and jakesmith committed Nov 17, 2023
1 parent 6c8cd36 commit b45d071
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/jlib/jfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7635,10 +7635,10 @@ class CBlockedFileIO : public CSimpleInterfaceOf<IFileIO>
offset_t readPos = (pos / blockSize) * blockSize; // NB: could be beyond end of file
if (readPos != lastReadPos)
{
readLen = io->read(readPos, blockSize, buffer); // NB: can be less than blockSize (and 0 if beyodn end of file)
readLen = io->read(readPos, blockSize, buffer); // NB: can be less than blockSize (and 0 if beyond end of file)
lastReadPos = readPos;
}
size32_t endPos = readPos+readLen;
offset_t endPos = readPos+readLen;
size32_t copyNow;
if (pos+len <= endPos) // common case hopefully
copyNow = len;
Expand Down

0 comments on commit b45d071

Please sign in to comment.