diff options
author | Eric Blake | 2021-11-15 23:39:43 +0100 |
---|---|---|
committer | Eric Blake | 2021-11-16 15:45:33 +0100 |
commit | 76df2b8d695b07d85cce7db753a51cdbfe42b445 (patch) | |
tree | da39022ad64309a3148f6a2931085ea78366f04c /hw/misc/mchp_pfsoc_ioscb.c | |
parent | Merge tag 'machine-core-20211115' of https://github.com/philmd/qemu into staging (diff) | |
download | qemu-76df2b8d695b07d85cce7db753a51cdbfe42b445.tar.gz qemu-76df2b8d695b07d85cce7db753a51cdbfe42b445.tar.xz qemu-76df2b8d695b07d85cce7db753a51cdbfe42b445.zip |
nbd/server: Silence clang sanitizer warning
clang's sanitizer is picky: memset(NULL, x, 0) is technically
undefined behavior, even though no sane implementation of memset()
deferences the NULL. Caught by the nbd-qemu-allocation iotest.
The alternative to checking before each memset is to instead force an
allocation of 1 element instead of g_new0(type, 0)'s behavior of
returning NULL for a 0-length array.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 3b1f244c59 (nbd: Allow export of multiple bitmaps for one device)
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211115223943.626416-1-eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/misc/mchp_pfsoc_ioscb.c')
0 files changed, 0 insertions, 0 deletions