From 70001dac8edaa045d72adbf2c1e68aea2429dc0a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 May 2026 19:11:50 +0200 Subject: Fix clang-sanitizer complaints on test code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test.c') diff --git a/test.c b/test.c index e06b6fe..83a58b1 100644 --- a/test.c +++ b/test.c @@ -667,7 +667,8 @@ hash_blake2xs(unsigned char **msg, size_t msglen, size_t *msgsize, params.depth = 1; params.xof_len = (uint_least16_t)hashlen; - memset(*out, 0xCC, *outsize); + if (*outsize) + memset(*out, 0xCC, *outsize); libblake_blake2xs_init(&state, ¶ms); *outlen = hashlen; @@ -732,7 +733,8 @@ hash_blake2xb(unsigned char **msg, size_t msglen, size_t *msgsize, params.depth = 1; params.xof_len = (uint_least32_t)hashlen; - memset(*out, 0xCC, *outsize); + if (*outsize) + memset(*out, 0xCC, *outsize); libblake_blake2xb_init(&state, ¶ms); *outlen = hashlen; -- cgit v1.3.1