make sure to initialize section idx for 32 bit

This commit is contained in:
Nick Chan committed 2026-05-26 21:41:04 +08:00
1 parent 0d4a97571a
commit 85470f3e07
1 file changed
+1 -1
+1 -1
View File
@@ -262,7 +262,7 @@ int parse_checkra1n32(void *c1) {
Elf32_Shdr *sections = (Elf32_Shdr *)((uint8_t *)c1 + hdr->e_shoff); Elf32_Shdr *sections = (Elf32_Shdr *)((uint8_t *)c1 + hdr->e_shoff);
char *strings = (char *)c1 + sections[hdr->e_shstrndx].sh_offset; char *strings = (char *)c1 + sections[hdr->e_shstrndx].sh_offset;
Elf32_Half text_idx, kpf_idx; Elf32_Half text_idx = 0, kpf_idx = 0;
for (Elf32_Half i = 0; i < hdr->e_shnum; i++) { for (Elf32_Half i = 0; i < hdr->e_shnum; i++) {
if (strcmp(&strings[sections[i].sh_name], ".text") == 0) if (strcmp(&strings[sections[i].sh_name], ".text") == 0)