Merge pull request #3508 from Sonicadvance1/stop_using_vla

ELFParser: Stop using a VLA
This commit is contained in:
Ryan Houdek 2024-03-25 12:18:37 -07:00 committed by GitHub
commit 32ec4a3c81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,9 +146,9 @@ struct ELFParser {
}
if (type == ::ELFLoader::ELFContainer::TYPE_X86_32) {
Elf32_Phdr phdrs32[ehdr.e_phnum];
fextl::vector<Elf32_Phdr> phdrs32(ehdr.e_phnum);
if (pread(fd, phdrs32, sizeof(Elf32_Phdr) * ehdr.e_phnum, ehdr.e_phoff) == -1) {
if (pread(fd, phdrs32.data(), sizeof(Elf32_Phdr) * ehdr.e_phnum, ehdr.e_phoff) == -1) {
LogMan::Msg::EFmt("Failed to read phdr32 from '{}'", fd);
return false;
}