Skip to content

Commit 96c8422

Browse files
Out-of-bounds read exists in the function modifyRPath
1 parent 75f25a3 commit 96c8422

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
@@ -1371,6 +1371,7 @@ void ElfFile<ElfFileParamNames>::modifyRPath(RPathOp op,
13711371
string. */
13721372
std::vector<std::string> neededLibs;
13731373
auto dyn = (Elf_Dyn *)(fileContents->data() + rdi(shdrDynamic.sh_offset));
1374+
checkPointer(fileContents, dyn, sizeof(*dyn));
13741375
Elf_Dyn *dynRPath = nullptr, *dynRunPath = nullptr;
13751376
char * rpath = nullptr;
13761377
for ( ; rdi(dyn->d_tag) != DT_NULL; dyn++) {

0 commit comments

Comments
 (0)