]> git.ipfire.org Git - thirdparty/grub.git/commit
util/grub-module-verifierXX: Changed get_shnum() return type
authorAlec Brown <alec.r.brown@oracle.com>
Fri, 12 Aug 2022 22:25:48 +0000 (18:25 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 19 Aug 2022 20:30:44 +0000 (22:30 +0200)
commit477ce462351d4bec557e3a60ef7b4a99613c1163
treee52110b1a74ba62c0733fbf1b9dc9ea746a57baf
parentddb6c1bafbb53ce68aae3e23dd63182a6bf74c36
util/grub-module-verifierXX: Changed get_shnum() return type

In util/grub-module-verifierXX.c, the function get_shnum() returns the variable
shnum, which is of the type Elf_Word. In the function, shnum can be obtained by
the e_shnum member of an Elf_Ehdr or the sh_size member of an Elf_Shdr. The
sh_size member can either be grub_uint32_t or grub_uint64_t, depending on the
architecture, but Elf_Word is only grub_uint32_t. To account for when sh_size is
grub_uint64_t, we can set shnum to have type Elf_Shnum and have get_shnum()
return an Elf_Shnum.

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-module-verifierXX.c