Initialize BSD relocator state variables
PATCH 1/1 Initialize BSD relocator state variables
Numerous register fields in the relocator state are simply not used depending on the relocator. This causes Coverity to flag these fields but there is no real bug here. Simply initializing the variable to {0} solves the issue. Fixed in the else case too for consistency.
Fixes CID 396932
Signed-off-by Ross Philipson <[email protected]>
--- grub-core/loader/i386/bsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
grub-core/loader/i386/bsd.c +2 -2
@@ -728,7 +728,7 @@ grub_freebsd_boot (void)if (is_64bit) { -struct grub_relocator64_state state; +struct grub_relocator64_state state = {0 };grub_uint8_t *pagetable;grub_uint32_t *stack;grub_addr_t stack_target;
@@ -767,7 +767,7 @@ grub_freebsd_boot (void) }else { -struct grub_relocator32_state state; +struct grub_relocator32_state state = {0 };grub_uint32_t *stack;grub_addr_t stack_target;
Signature · 1 line
2.37.1
Quoted 9 lines · Ross Philipson
Numerous register fields in the relocator state are simply not used depending on the relocator. This causes Coverity to flag these fields but there is no real bug here. Simply initializing the variable to {0} solves the issue. Fixed in the else case too for consistency.
Fixes CID 396932Signed-off-by Ross Philipson <[email protected]>
Reviewed-by Daniel Kiper <[email protected]>
Daniel