lib/elf: Avoid undefined pointer arithmetic in relocation patching

This commit is contained in:
Mintsuki
2026-04-14 02:12:40 +02:00
parent 3042d4fa74
commit 05e8144c9b

View File

@@ -513,7 +513,7 @@ end_of_pt_segment:
continue; continue;
// It's inside it, calculate where it is // It's inside it, calculate where it is
uint64_t *ptr = (uint64_t *)((buffer - vaddr) + relocation->r_addr); uint64_t *ptr = (uint64_t *)(buffer + (relocation->r_addr - vaddr));
switch (relocation->r_info) { switch (relocation->r_info) {
#if defined (__x86_64__) || defined (__i386__) #if defined (__x86_64__) || defined (__i386__)