mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibELF+Kernel: Validate program headers in Image::parse
This should catch more malformed ELF files earlier than simply checking the ELF header alone. Also change the API of validate_program_headers to take the interpreter_path by pointer. This makes it less awkward to call when we don't care about the interpreter, and just want the validation.
This commit is contained in:
parent
8297698a3a
commit
3f808b0dda
5 changed files with 30 additions and 15 deletions
|
@ -151,6 +151,12 @@ bool Image::parse()
|
|||
return m_valid = false;
|
||||
}
|
||||
|
||||
if (!validate_program_headers(header(), m_size, m_buffer, m_size, nullptr, m_verbose_logging)) {
|
||||
if (m_verbose_logging)
|
||||
dbgputstr("Image::parse(): ELF Program Headers not valid\n");
|
||||
return m_valid = false;
|
||||
}
|
||||
|
||||
m_valid = true;
|
||||
|
||||
// First locate the string tables.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue