76df2b8d69
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:
|
||
---|---|---|
.. | ||
client-connection.c | ||
client.c | ||
common.c | ||
meson.build | ||
nbd-internal.h | ||
server.c | ||
trace-events | ||
trace.h |