1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

UserspaceEmulator: Don't scan text segment for malloc leaks

There will be no (true positive) malloc addresses in the text segment.
This commit is contained in:
Andreas Kling 2020-07-16 19:27:03 +02:00
parent 3dc1c80958
commit e50874621a
3 changed files with 8 additions and 0 deletions

View file

@ -108,6 +108,8 @@ bool Emulator::load_elf()
m_elf->image().for_each_program_header([&](const ELF::Image::ProgramHeader& program_header) {
if (program_header.type() == PT_LOAD) {
auto region = make<SimpleRegion>(program_header.vaddr().get(), program_header.size_in_memory());
if (program_header.is_executable() && !program_header.is_writable())
region->set_text(true);
memcpy(region->data(), program_header.raw_data(), program_header.size_in_image());
mmu().add_region(move(region));
return;