Skip to content

Commit

Permalink
Merge pull request #419 from xiaoxiaoafeifei/master
Browse files Browse the repository at this point in the history
Fix Out-of-bounds read in the function modifyRPath
  • Loading branch information
Mic92 authored Oct 26, 2022
2 parents ea989ae + 96c8422 commit b751eeb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/patchelf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
string. */
std::vector<std::string> neededLibs;
auto dyn = (Elf_Dyn *)(fileContents->data() + rdi(shdrDynamic.sh_offset));
checkPointer(fileContents, dyn, sizeof(*dyn));
Elf_Dyn *dynRPath = nullptr, *dynRunPath = nullptr;
char * rpath = nullptr;
for ( ; rdi(dyn->d_tag) != DT_NULL; dyn++) {
Expand Down

0 comments on commit b751eeb

Please sign in to comment.