diff options
author | Eric Blake <eblake@redhat.com> | 2021-11-15 16:39:43 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2021-11-16 08:45:33 -0600 |
commit | 76df2b8d695b07d85cce7db753a51cdbfe42b445 (patch) | |
tree | da39022ad64309a3148f6a2931085ea78366f04c /hmp-commands-info.hx | |
parent | 9f0f846465d4c52ce9857787e947dffb64367fae (diff) |
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 'hmp-commands-info.hx')
0 files changed, 0 insertions, 0 deletions