mirror of
https://github.com/limine-bootloader/limine
synced 2024-11-30 12:23:10 +03:00
bootboot: Fix potential buffer overflow in bruteforce_kernel() (see #124)
This commit is contained in:
parent
42cd7d95ac
commit
8b81412e14
@ -7,7 +7,7 @@
|
||||
#include <lib/blib.h>
|
||||
|
||||
struct initrd_file bruteforce_kernel(struct initrd_file file) {
|
||||
for (size_t i = 0; i < file.size; i++) {
|
||||
for (size_t i = 0; i < file.size - 19; i++) {
|
||||
if (memcmp(file.data + i, "\177ELF", 4) == 0
|
||||
&& file.data[i + 18] == 62 && file.data[i + 19] == 0 /* ehdr->e_machine == EM_X86_64 */) {
|
||||
printv("bootboot: using bruteforced kernel at initrd offset %X\n", file.data + i);
|
||||
|
Loading…
Reference in New Issue
Block a user