DynamicLoader: Don't do file backed mapping for filesz == 0

This commit is contained in:
Bananymous 2024-09-05 14:50:05 +03:00
parent 4e15b9cdfa
commit 19d16620a6
1 changed files with 1 additions and 1 deletions

View File

@ -622,7 +622,7 @@ static void load_program_header(const ElfNativeProgramHeader& program_header, in
return result;
}();
if ((program_header.p_vaddr & 0xFFF) || (program_header.p_offset & 0xFFF))
if ((program_header.p_vaddr & 0xFFF) || (program_header.p_offset & 0xFFF) || program_header.p_filesz == 0)
{
const uintptr_t aligned_addr = program_header.p_vaddr & ~(uintptr_t)0xFFF;