diff options
author | Breno Rodrigues Guimaraes <brenorg@gmail.com> | 2023-03-17 19:06:12 -0300 |
---|---|---|
committer | Breno Rodrigues Guimaraes <brenorg@gmail.com> | 2023-03-17 19:06:57 -0300 |
commit | c749f6760d69f6594a8b84ba8ab195d838766d89 (patch) | |
tree | 427ac278f5b0f41f474584d3b1bf930a415a67ad | |
parent | 27cbc89d4830d5ae1fe3a2396f2a6042266895bc (diff) | |
download | patchelf-c749f6760d69f6594a8b84ba8ab195d838766d89.tar.gz |
Use a different letter for section tainting
-rw-r--r-- | src/patchelf.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc index 1a90edb..37e6479 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -664,14 +664,14 @@ template<ElfFileParams> void ElfFile<ElfFileParamNames>::writeReplacedSections(Elf_Off & curOff, Elf_Addr startAddr, Elf_Off startOffset) { - /* Overwrite the old section contents with 'X's. Do this + /* Overwrite the old section contents with 'Z's. Do this *before* writing the new section contents (below) to prevent clobbering previously written new section contents. */ for (auto & i : replacedSections) { const std::string & sectionName = i.first; const Elf_Shdr & shdr = findSectionHeader(sectionName); if (rdi(shdr.sh_type) != SHT_NOBITS) - memset(fileContents->data() + rdi(shdr.sh_offset), 'X', rdi(shdr.sh_size)); + memset(fileContents->data() + rdi(shdr.sh_offset), 'Z', rdi(shdr.sh_size)); } std::set<unsigned int> noted_phdrs = {}; |