mirror of
https://github.com/avast/retdec.git
synced 2024-11-27 06:40:29 +00:00
Fix .NET parser trying to read out-of-bounds of the file
This commit is contained in:
parent
6238ecada5
commit
84482a38d9
@ -2593,6 +2593,13 @@ void PeFormat::parseStringStream(std::uint64_t baseAddress, std::uint64_t offset
|
||||
while (currentOffset < size)
|
||||
{
|
||||
std::string string;
|
||||
std::uint64_t c = 0;
|
||||
auto successful_read = get1Byte(address + currentOffset, c, getEndianness());
|
||||
// If the reading fails (OOB or other) don't continue and terminate
|
||||
if (!successful_read)
|
||||
{
|
||||
break;
|
||||
}
|
||||
getNTBS(address + currentOffset, string);
|
||||
stringStream->addString(currentOffset, string);
|
||||
// +1 for null-terminator
|
||||
|
Loading…
Reference in New Issue
Block a user