Re: [PATCH v2 1/1] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter

2020-07-30 Thread Cornelia Huck
On Thu, 30 Jul 2020 15:01:56 +0200 Halil Pasic wrote: > As pointed out by Peter, g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1) > reads one past of the end of ms->loadparm, so g_memdup() can not be used > here. > > Let's use g_strndup instead! > > Fixes: d664548328 ("s390x/s390-virtio-ccw: fi

Re: [PATCH v2 1/1] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter

2020-07-30 Thread David Hildenbrand
On 30.07.20 15:01, Halil Pasic wrote: > As pointed out by Peter, g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1) > reads one past of the end of ms->loadparm, so g_memdup() can not be used > here. > > Let's use g_strndup instead! > > Fixes: d664548328 ("s390x/s390-virtio-ccw: fix loadparm propert

Re: [PATCH v2 1/1] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter

2020-07-30 Thread Peter Maydell
On Thu, 30 Jul 2020 at 14:02, Halil Pasic wrote: > > As pointed out by Peter, g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1) > reads one past of the end of ms->loadparm, so g_memdup() can not be used > here. > > Let's use g_strndup instead! > > Fixes: d664548328 ("s390x/s390-virtio-ccw: fix load

[PATCH v2 1/1] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter

2020-07-30 Thread Halil Pasic
As pointed out by Peter, g_memdup(ms->loadparm, sizeof(ms->loadparm) + 1) reads one past of the end of ms->loadparm, so g_memdup() can not be used here. Let's use g_strndup instead! Fixes: d664548328 ("s390x/s390-virtio-ccw: fix loadparm property getter") Fixes: Coverity CID 1431058 Reported-by: