qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Cornelia Huck
Subject: Re: [PATCH v2 1/1] s390x/s390-virtio-ccw: fix off-by-one in loadparm getter
Date: Thu, 30 Jul 2020 17:06:56 +0200

On Thu, 30 Jul 2020 15:01:56 +0200
Halil Pasic <pasic@linux.ibm.com> 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 property getter")
> Fixes: Coverity CID 1431058
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> ---
>  hw/s390x/s390-virtio-ccw.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Thanks, queued to s390-fixes.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]