mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
readelf: Don't error out on invalid interpreter path
This lets us inspect ELF binaries with un-loadable program interpreters, same as binutils and llvm-readelf.
This commit is contained in:
parent
4b0b22d897
commit
9b041786ac
Notes:
sideshowbarker
2024-07-17 11:24:04 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/9b041786ac Pull-request: https://github.com/SerenityOS/serenity/pull/13862 Reviewed-by: https://github.com/BertalanD ✅
@ -325,16 +325,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
|
||||
if (interpreter_file_or_error.is_error()) {
|
||||
warnln("Unable to map interpreter file {}: {}", interpreter_path, interpreter_file_or_error.error());
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
auto interpreter_image_data = interpreter_file_or_error.value()->bytes();
|
||||
|
||||
auto interpreter_image_data = interpreter_file_or_error.value()->bytes();
|
||||
ELF::Image interpreter_image(interpreter_image_data);
|
||||
|
||||
ELF::Image interpreter_image(interpreter_image_data);
|
||||
|
||||
if (!interpreter_image.is_valid()) {
|
||||
warnln("ELF interpreter image is invalid");
|
||||
return -1;
|
||||
if (!interpreter_image.is_valid()) {
|
||||
warnln("ELF interpreter image is invalid");
|
||||
}
|
||||
}
|
||||
|
||||
int fd = TRY(Core::System::open(path, O_RDONLY));
|
||||
|
Loading…
Reference in New Issue
Block a user