Skip to content

Commit 35a279f

Browse files
committed
fix: only iterate the main executable program headers
The resource gets injected in the main executable, so there is no need to iterate the other shared libraries that are loaded by the program. This also resolves a security concern. Refs: #77 (review) Signed-off-by: Darshan Sen <[email protected]>
1 parent 19ab453 commit 35a279f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

postject-api.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ static int postject__dl_iterate_phdr_callback(struct dl_phdr_info* info,
9191
}
9292
}
9393

94-
// skip to the next shared object
95-
return 0;
94+
// wasn't able to find the note in the main executable program headers, so
95+
// terminate the search
96+
return 1;
9697
}
9798
#endif
9899

0 commit comments

Comments
 (0)