aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Brown <alec.r.brown@oracle.com>2022-03-21 02:28:59 -0400
committerDaniel Kiper <daniel.kiper@oracle.com>2022-04-04 20:28:55 +0200
commit4fa5dd08f56dcadb87f6e456727b92fa5cdbf067 (patch)
tree158f696a2e2dafc7ecabc167d2c9e11cb55bf3ff
parent261e4511ce335cc3784cbbe6c99fd35a81efa059 (diff)
downloadgrub-4fa5dd08f56dcadb87f6e456727b92fa5cdbf067.tar.gz
loader/i386/xnu: Fix uninitialized scalar variable
In the function grub_xnu_boot_resume(), 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 esi, and grub_uint32_t edi 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 375031 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>
-rw-r--r--grub-core/loader/i386/xnu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c
index c516d0c6c..da962175f 100644
--- a/grub-core/loader/i386/xnu.c
+++ b/grub-core/loader/i386/xnu.c
@@ -805,7 +805,7 @@ grub_cpu_xnu_fill_devicetree (grub_uint64_t *fsbfreq_out)
grub_err_t
grub_xnu_boot_resume (void)
{
- struct grub_relocator32_state state;
+ struct grub_relocator32_state state = {0};
state.esp = grub_xnu_stack;
state.ebp = grub_xnu_stack;