Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parser/AbstractByteBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BYTE* AbstractByteBuffer::getContentAt(offset_t offset, bufsize_t size, bool all
return NULL;
}
const offset_t endOffset = offset + size;
if (endOffset > fileSize) {
if (size > fileSize - offset) { // offset < fileSize: no underflow; offset + size may wrap
if (allowExceptions) throw BufferException("Too big size requested! Buffer size: "
+ QString::number(fileSize) + " vs end of the requested area: 0x" + QString::number(endOffset, 16));
return NULL;
Expand Down