:: commit 54e88823286d993bc3cc1f4ef3f163e2158c71a4

mintsuki <mintsuki@protonmail.com> — 2024-06-04 00:06

parents: 9789274c6d

lib/elf: Fix a GCC uninitialised var warning

diff --git a/common/lib/elf.c b/common/lib/elf.c
index 76deb96b..60702b22 100644
--- a/common/lib/elf.c
+++ b/common/lib/elf.c
@@ -407,7 +407,7 @@ static bool elf64_apply_relocations(uint8_t *elf, struct elf64_hdr *hdr, void *b
         }
 
         // This logic is partially lifted from https://maskray.me/blog/2021-10-31-relative-relocations-and-relr
-        uint64_t where;
+        uint64_t where = 0;
         relr_i = 0;
         for (size_t i = 0; i < relr_size / relr_ent; i++) {
             uint64_t entry = *((uint64_t *)(elf + relr_offset + i * relr_ent));
tab: 248 wrap: offon