mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
fix(kernel/elf): check if vector is empty before calling .front()
This commit is contained in:
parent
366fd97c0a
commit
f5c9b561a9
@ -455,13 +455,14 @@ namespace Execute
|
|||||||
debug("gdb: \"-exec add-symbol-file-all /workspaces/Fennix/tmp_rootfs%s %#lx\" entry:%#lx", sanitizedPath.c_str(), base, entry);
|
debug("gdb: \"-exec add-symbol-file-all /workspaces/Fennix/tmp_rootfs%s %#lx\" entry:%#lx", sanitizedPath.c_str(), base, entry);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Elf_Phdr interp = ELFGetSymbolType(fd, PT_INTERP).front();
|
std::vector<Elf_Phdr> interpVec = ELFGetSymbolType(fd, PT_INTERP);
|
||||||
if (interp.p_offset == 0)
|
if (interpVec.empty())
|
||||||
{
|
{
|
||||||
debug("No interpreter found");
|
debug("No interpreter found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Elf_Phdr interp = interpVec.front();
|
||||||
std::string interpreterPath;
|
std::string interpreterPath;
|
||||||
interpreterPath.resize(256);
|
interpreterPath.resize(256);
|
||||||
fd->Read(interpreterPath.data(), 256, interp.p_offset);
|
fd->Read(interpreterPath.data(), 256, interp.p_offset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user