Skip to content

Commit 5b27dc4

Browse files
xiaoxiaoafeifeiEricson2314
authored andcommitted
Out-of-bounds read exists in the function modifyRPath
(cherry picked from commit 96c8422)
1 parent 76486f7 commit 5b27dc4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/patchelf.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
12991299
string. */
13001300
std::vector<std::string> neededLibs;
13011301
auto dyn = (Elf_Dyn *)(fileContents->data() + rdi(shdrDynamic.sh_offset));
1302+
checkPointer(fileContents, dyn, sizeof(*dyn));
13021303
Elf_Dyn *dynRPath = nullptr, *dynRunPath = nullptr;
13031304
char * rpath = nullptr;
13041305
for ( ; rdi(dyn->d_tag) != DT_NULL; dyn++) {

0 commit comments

Comments
 (0)