mirror of
https://github.com/avast/retdec.git
synced 2024-11-23 13:00:13 +00:00
Merge pull request #1166 from avast/dotnet-looping
Fix .NET parser trying to read strings from String stream when out-of-bounds of the file
This commit is contained in:
commit
f7e82bb6b2
@ -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