aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-01-21 07:15:52 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2014-01-21 07:18:41 -0800
commitf775e740a3a817a4ff5ba26bea99dbfd735456b3 (patch)
treeaa8e9fedc331bc1136652226f6c97f4dcb950676
parentb4cd1a45b9ca8ed5a0cd214231103bacd3e067e8 (diff)
downloadsyslinux-f775e740a3a817a4ff5ba26bea99dbfd735456b3.tar.gz
syslinux-f775e740a3a817a4ff5ba26bea99dbfd735456b3.tar.xz
syslinux-f775e740a3a817a4ff5ba26bea99dbfd735456b3.zip
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 <erwanaliasr1@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--core/localboot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/localboot.c b/core/localboot.c
index 0f4b5820..b68d3f2c 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);