]> git.ipfire.org Git - thirdparty/grub.git/commit
loader/i386/xnu: Fix uninitialized scalar variable
authorAlec Brown <alec.r.brown@oracle.com>
Mon, 21 Mar 2022 06:29:01 +0000 (02:29 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 4 Apr 2022 18:28:55 +0000 (20:28 +0200)
commita97d1ebb8eda29f5676d6b347b3698598e8519eb
tree08537d28b9fb50352fb7449130856e5eb31e11f3
parent4fa5dd08f56dcadb87f6e456727b92fa5cdbf067
loader/i386/xnu: Fix uninitialized scalar variable

In the function grub_xnu_boot(), struct grub_relocator32_state state is called
but isn't being initialized. This results in the members grub_uint32_t ebx,
grub_uint32_t ecx, grub_uint32_t edx, grub_uint32_t edi, and grub_uint32_t esi
being filled with junk data from the stack since none of them are being set to
any values. We can prevent this by setting state to {0}.

Fixes: CID 375035
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>
grub-core/loader/i386/xnu.c