From f775e740a3a817a4ff5ba26bea99dbfd735456b3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 21 Jan 2014 07:15:52 -0800 Subject: [PATCH] localboot: Clear register image before using Using a register image on the stack without initializing it is not a good idea. Reported-by: Erwan Velu Signed-off-by: H. Peter Anvin --- core/localboot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/localboot.c b/core/localboot.c index 0f4b582..b68d3f2 100644 --- a/core/localboot.c +++ b/core/localboot.c @@ -57,6 +57,7 @@ __export void local_boot(int16_t ax) * Load boot sector from the specified BIOS device and jump to * it. */ + memset(&ireg, 0, sizeof ireg); ireg.edx.b[0] = ax & 0xff; ireg.eax.w[0] = 0; /* Reset drive */ __intcall(0x13, &ireg, NULL); -- 2.7.4