From 074afe60d4c8167dcfaee7aca1065c6360449eaa Mon Sep 17 00:00:00 2001 From: Collin Walling Date: Mon, 16 Apr 2018 12:56:08 -0400 Subject: pc-bios/s390-ccw: fix loadparm initialization and int conversion Rename the loadparm char array in main.c to loadparm_str and increased the size by one byte to account for a null termination when converting the loadparm string to an int via atoui. We also allow the boot menu to be enabled when loadparm is set to an empty string or a series of spaces. Signed-off-by: Collin Walling Reported-by: Vasily Gorbik Reviewed-by: Thomas Huth Reviewed-by: Janosch Frank Signed-off-by: Thomas Huth --- hw/s390x/ipl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw') diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index fb554ab156..150f6c0582 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -373,6 +373,10 @@ int s390_ipl_set_loadparm(uint8_t *loadparm) loadparm[i] = ascii2ebcdic[(uint8_t) lp[i]]; } + if (i < 8) { + memset(loadparm + i, 0x40, 8 - i); /* fill with EBCDIC spaces */ + } + g_free(lp); return 0; } -- cgit v1.2.1