Skip to content

Commit

Permalink
Fix invalid memory read in PeLib::CoffSymbolTable::read() (#840) (#841)
Browse files Browse the repository at this point in the history
Fixes #840.

Co-authored-by: Ladislav Zezula <[email protected]>
  • Loading branch information
ladislav-zezula and Ladislav Zezula authored Aug 15, 2020
1 parent 4cf40b4 commit c5b0374
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pelib/CoffSymbolTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ namespace PeLib
// Read size of string table
if (ulFileSize >= stringTableOffset + 4)
{
stringTable.resize(sizeof(std::uint32_t));
memcpy(&stringTableSize, fileData.data() + stringTableOffset, sizeof(uint32_t));
*reinterpret_cast<std::uint32_t *>(stringTable.data()) = stringTableSize;
uiOffset = stringTableOffset + sizeof(uint32_t);
}

Expand Down

0 comments on commit c5b0374

Please sign in to comment.