Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200731' int…
Browse files Browse the repository at this point in the history
…o staging

Fix a problem introduced in a recent fix.

# gpg: Signature made Fri 31 Jul 2020 09:50:28 BST
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Cornelia Huck <[email protected]>" [marginal]
# gpg:                 aka "Cornelia Huck <[email protected]>" [full]
# gpg:                 aka "Cornelia Huck <[email protected]>" [full]
# gpg:                 aka "Cornelia Huck <[email protected]>" [marginal]
# gpg:                 aka "Cornelia Huck <[email protected]>" [marginal]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20200731:
  s390x/s390-virtio-ccw: fix off-by-one in loadparm getter

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Jul 31, 2020
2 parents 1448629 + 148d25e commit d74824c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions hw/s390x/s390-virtio-ccw.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,9 @@ bool hpage_1m_allowed(void)
static char *machine_get_loadparm(Object *obj, Error **errp)
{
S390CcwMachineState *ms = S390_CCW_MACHINE(obj);
char *loadparm_str;

/* make a NUL-terminated string */
loadparm_str = g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1);
loadparm_str[sizeof(ms->loadparm)] = 0;
return loadparm_str;
return g_strndup((char *) ms->loadparm, sizeof(ms->loadparm));
}

static void machine_set_loadparm(Object *obj, const char *val, Error **errp)
Expand Down

0 comments on commit d74824c

Please sign in to comment.