Fix error

This commit is contained in:
Romain Thomas 2021-02-24 07:35:26 +01:00
parent 0e12916531
commit 1dd7317a0c

View File

@ -376,12 +376,12 @@ void Builder::build_sections(void) {
for (size_t i = 0; i < this->binary_->sections_.size(); i++) {
const Section* section = this->binary_->sections_[i];
LIEF_DEBUG("Writing content of section '{}'", section->name());
const std::string name = section->name();
auto&& it_offset_name = std::search(
std::begin(section_names),
std::end(section_names),
section->name().c_str(),
section->name().c_str() + section->name().size() + 1);
const auto it_offset_name = std::search(
std::begin(section_names), std::end(section_names),
name.c_str(),
name.c_str() + name.size() + 1);
if (it_offset_name == std::end(section_names)) {
throw LIEF::not_found("Section name not found");