Skip to content

Commit

Permalink
HPCC-30884 Overflow causing truncation using blockedSizeIO
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Nov 17, 2023
1 parent f5099a4 commit dcb7ef0
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 @@ -7700,10 +7700,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 dcb7ef0

Please sign in to comment.