mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
loader/i386/pc/linux: Fix uninitialized scalar variable
In the function grub_linux16_boot(), struct grub_relocator16_state state is
called but isn't being initialized. This results in the members grub_uint32_t
ebx, grub_uint32_t edx, grub_uint32_t esi, and grub_uint32_t ebp 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 375028
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>
This commit is contained in:
1 parent
c0272c12b6
commit
261e4511ce
1 file changed
+1
-1
@@ -55,7 +55,7 @@ static grub_err_t
|
||||
grub_linux16_boot (void)
|
||||
{
|
||||
grub_uint16_t segment;
|
||||
struct grub_relocator16_state state;
|
||||
struct grub_relocator16_state state = {0};
|
||||
|
||||
segment = grub_linux_real_target >> 4;
|
||||
state.gs = state.fs = state.es = state.ds = state.ss = segment;
|
||||
|
||||
Reference in new issue
Block a user