]> git.proxmox.com Git - mirror_qemu.git/commit
qtest.c: Allow zero size in memset qtest commands
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 5 Aug 2016 10:43:20 +0000 (11:43 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 9 Sep 2016 10:16:18 +0000 (11:16 +0100)
commit5f31bbf1015abd3fc27c7f87b8db65aba2c8164d
tree4a43a0168a357d720cd0b0e84098e66dc1fdb4b2
parent33e60e01988b02ac9baf4dc0f4a452b39fb5ce55
qtest.c: Allow zero size in memset qtest commands

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.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1470393800-7882-1-git-send-email-peter.maydell@linaro.org
qtest.c