Skip to content

Commit

Permalink
Fix error handling issue in ELF parser
Browse files Browse the repository at this point in the history
First bug found via fuzzing.
  • Loading branch information
chaoticgd committed Oct 31, 2024
1 parent adf4c53 commit 794e844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ccc/elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Result<ElfFile> ElfFile::parse(std::vector<u8> image)
CCC_CHECK(section_header, "ELF section header out of range.");

const char* name = get_string(elf.image, shstr_section_header->offset + section_header->name);
CCC_CHECK(section_header, "ELF section name out of range.");
CCC_CHECK(name, "ELF section name out of range.");

ElfSection& section = elf.sections.emplace_back();
section.name = name;
Expand Down

0 comments on commit 794e844

Please sign in to comment.