On 8 September 2016 at 15:37, Eric Blake <ebl...@redhat.com> 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 <peter.mayd...@linaro.org> >> --- >> 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 <ebl...@redhat.com>
Applied to master, thanks. -- PMM