mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
Kernel: Ignore zero-sized PT_LOAD headers when loading ELF images
This commit is contained in:
parent
0819f0a3fd
commit
5046a1fe38
Notes:
sideshowbarker
2024-07-18 05:00:29 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5046a1fe381
1 changed files with 3 additions and 0 deletions
|
@ -338,6 +338,9 @@ static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Memory::AddressSpace>
|
|||
if (program_header.type() != PT_LOAD)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
if (program_header.size_in_memory() == 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
if (program_header.is_writable()) {
|
||||
// Writable section: create a copy in memory.
|
||||
VERIFY(program_header.size_in_memory());
|
||||
|
|
Loading…
Reference in a new issue