1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibELF: Use StringBuilders instead of Strings for the interpreter path

This is required for the Kernel's usage of LibELF, since Strings do not
expose allocation failure.
This commit is contained in:
Idan Horowitz 2022-01-13 18:50:17 +02:00 committed by Andreas Kling
parent fb3e46e930
commit 3e959618c3
8 changed files with 36 additions and 18 deletions

View file

@ -8,10 +8,11 @@
#include <AK/String.h>
#include <LibC/elf.h>
#include <limits.h>
namespace ELF {
bool validate_elf_header(const ElfW(Ehdr) & elf_header, size_t file_size, bool verbose = true);
bool validate_program_headers(const ElfW(Ehdr) & elf_header, size_t file_size, const u8* buffer, size_t buffer_size, String* interpreter_path, bool verbose = true);
ErrorOr<bool> validate_program_headers(const ElfW(Ehdr) & elf_header, size_t file_size, const u8* buffer, size_t buffer_size, StringBuilder* interpreter_path_builder, bool verbose = true);
} // end namespace ELF