[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.7] qtest.c: Allow zero size in memset qtes
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH for-2.7] qtest.c: Allow zero size in memset qtest commands |
Date: |
Fri, 9 Sep 2016 12:49:20 +0100 |
On 8 September 2016 at 15:37, Eric Blake <address@hidden> wrote:
> On 08/05/2016 05:43 AM, Peter Maydell wrote:
>> Some tests use the qtest protocol "memset" command with a zero
>> size, expecting it to do nothing. However in the current code this
>> will result in calling memset() with a NULL pointer, which is
>> undefined behaviour. Detect and specially handle zero sizes to
>> avoid this.
>>
>> Signed-off-by: Peter Maydell <address@hidden>
>> ---
>> Looking at the code for the other commands that take a size
>> ('read', 'write', 'b64read' and 'b64write' they all assume a
>> non-zero size. I've left those alone though, somebody else can
>> make them do nothing on zero size if they feel it's important.)
>
> I obviously missed reviewing this in time for 2.7, but looks reasonable
> to me.
>
> Reviewed-by: Eric Blake <address@hidden>
Applied to master, thanks.
-- PMM