aboutsummaryrefslogtreecommitdiffstats
path: root/com32/cmenu
diff options
context:
space:
mode:
authorErwan Velu <erwan@enovance.com>2014-01-22 23:57:12 +0100
committerErwan Velu <erwan@enovance.com>2014-01-22 23:57:12 +0100
commit3150c7839640859e8ec6ea0243002309e5f9c068 (patch)
tree275ff162a0252960548013afbe8ff7da7e9cffc0 /com32/cmenu
parent7a9978f280e1d291f6fac419e7c2a0178e9e5d6b (diff)
downloadsyslinux-3150c7839640859e8ec6ea0243002309e5f9c068.tar.gz
syslinux-3150c7839640859e8ec6ea0243002309e5f9c068.tar.xz
syslinux-3150c7839640859e8ec6ea0243002309e5f9c068.zip
com32sys_t inreg shall be zeroified prior intcall
As per commit f775e740a3a817a4ff5ba26bea99dbfd735456b3, inreg parameters of intcall() shall be zeroified. Having unclean inreg could trigger bad behaviors on some hosts. This patch is about adding memset() calls prior any intcall() : - some intcall didn't had any memset at all - some successive intcall() calls didn't memset inreg in between calls
Diffstat (limited to 'com32/cmenu')
-rw-r--r--com32/cmenu/libmenu/com32io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/com32/cmenu/libmenu/com32io.c b/com32/cmenu/libmenu/com32io.c
index 8e5016be..6954c438 100644
--- a/com32/cmenu/libmenu/com32io.c
+++ b/com32/cmenu/libmenu/com32io.c
@@ -20,6 +20,7 @@ com32sys_t inreg, outreg; // Global register sets for use
void getpos(char *row, char *col, char page)
{
+ memset(&inreg, 0, sizeof inreg);
REG_AH(inreg) = 0x03;
REG_BH(inreg) = page;
__intcall(0x10, &inreg, &outreg);
@@ -30,6 +31,7 @@ void getpos(char *row, char *col, char page)
char inputc(char *scancode)
{
syslinux_idle(); /* So syslinux can perform periodic activity */
+ memset(&inreg, 0, sizeof inreg);
REG_AH(inreg) = 0x10;
__intcall(0x16, &inreg, &outreg);
if (scancode)
@@ -40,6 +42,7 @@ char inputc(char *scancode)
void getcursorshape(char *start, char *end)
{
char page = 0; // XXX TODO
+ memset(&inreg, 0, sizeof inreg);
REG_AH(inreg) = 0x03;
REG_BH(inreg) = page;
__intcall(0x10, &inreg, &outreg);
@@ -49,6 +52,7 @@ void getcursorshape(char *start, char *end)
void setcursorshape(char start, char end)
{
+ memset(&inreg, 0, sizeof inreg);
REG_AH(inreg) = 0x01;
REG_CH(inreg) = start;
REG_CL(inreg) = end;
@@ -57,6 +61,7 @@ void setcursorshape(char start, char end)
void setvideomode(char mode)
{
+ memset(&inreg, 0, sizeof inreg);
REG_AH(inreg) = 0x00;
REG_AL(inreg) = mode;
__intcall(0x10, &inreg, &outreg);
@@ -65,6 +70,7 @@ void setvideomode(char mode)
// Get char displayed at current position
unsigned char getcharat(char page)
{
+ memset(&inreg, 0, sizeof inreg);
REG_AH(inreg) = 0x08;
REG_BH(inreg) = page;
__intcall(0x16, &inreg, &outreg);