Do not trunc section's name on a null char

If the section's name contains bytes after the null char, they should
be considered while computing the authentihash.
This commit is contained in:
Romain Thomas 2021-02-21 11:42:30 +01:00
parent c37ee0742a
commit 03a18cb202

View File

@ -46,7 +46,7 @@ Section::Section(const pe_section* header) :
characteristics_{header->Characteristics},
types_{PE_SECTION_TYPES::UNKNOWN}
{
this->name_ = std::string(header->Name, sizeof(header->Name)).c_str();
this->name_ = std::string(header->Name, sizeof(header->Name));
this->virtual_address_ = header->VirtualAddress;
this->size_ = header->SizeOfRawData;
this->offset_ = header->PointerToRawData;