aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorHalil Pasic <pasic@linux.ibm.com>2020-03-20 15:31:01 +0100
committerCornelia Huck <cohuck@redhat.com>2020-03-23 12:36:27 +0100
commit7722837369eb1c7e808021d79da68afa0c01c26f (patch)
tree83954f0d4087fc845e53083d5e7e80e2fbe43432 /hw/s390x
parentf58f084e71c6aeee066a30fc87422820e94a6cfc (diff)
s390/ipl: fix off-by-one in update_machine_ipl_properties()
In update_machine_ipl_properties() the array ascii_loadparm needs to hold the 8 char loadparm and a string terminating zero char. Let's increase the size of ascii_loadparm accordingly. Signed-off-by: Halil Pasic <pasic@linux.ibm.com> Fixes: 0a01e082a428 ("s390/ipl: sync back loadparm") Fixes: Coverity CID 1421966 Reported-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200320143101.41764-1-pasic@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/ipl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index b81942e1e6..8c3e019571 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -546,7 +546,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb)
/* Sync loadparm */
if (iplb->flags & DIAG308_FLAGS_LP_VALID) {
uint8_t *ebcdic_loadparm = iplb->loadparm;
- char ascii_loadparm[8];
+ char ascii_loadparm[9];
int i;
for (i = 0; i < 8 && ebcdic_loadparm[i]; i++) {