1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:48:13 +00:00

LibELF: Ensure that DynamicLoader only receives absolute paths

While at it, start renaming variables where we know that they store a
path, so that we will get less confused in the future.
This commit is contained in:
Tim Schumacher 2022-10-28 16:30:27 +02:00 committed by Linus Groh
parent a1de15498d
commit 177a5baf60
5 changed files with 23 additions and 16 deletions

View file

@ -39,6 +39,8 @@ namespace ELF {
Result<NonnullRefPtr<DynamicLoader>, DlErrorMessage> DynamicLoader::try_create(int fd, String filename, String filepath)
{
VERIFY(filepath.starts_with('/'));
struct stat stat;
if (fstat(fd, &stat) < 0) {
return DlErrorMessage { "DynamicLoader::try_create fstat" };