mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-27 02:49:56 +03:00
Fix bug in elf lib where a very large buffer could be accidentally allocated on the stack
This commit is contained in:
parent
01399b2e49
commit
7867d23e45
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
@ -206,7 +206,7 @@ int elf64_load_section(struct file_handle *fd, void *buffer, const char *name, s
|
||||
fread(fd, &shstrtab, hdr.shoff + hdr.shstrndx * sizeof(struct elf64_shdr),
|
||||
sizeof(struct elf64_shdr));
|
||||
|
||||
char names[shstrtab.sh_size];
|
||||
char *names = ext_mem_alloc(shstrtab.sh_size);
|
||||
fread(fd, names, shstrtab.sh_offset, shstrtab.sh_size);
|
||||
|
||||
for (uint16_t i = 0; i < hdr.sh_num; i++) {
|
||||
@ -250,7 +250,7 @@ int elf32_load_section(struct file_handle *fd, void *buffer, const char *name, s
|
||||
fread(fd, &shstrtab, hdr.shoff + hdr.shstrndx * sizeof(struct elf32_shdr),
|
||||
sizeof(struct elf32_shdr));
|
||||
|
||||
char names[shstrtab.sh_size];
|
||||
char *names = ext_mem_alloc(shstrtab.sh_size);
|
||||
fread(fd, names, shstrtab.sh_offset, shstrtab.sh_size);
|
||||
|
||||
for (uint16_t i = 0; i < hdr.sh_num; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user