aboutsummaryrefslogtreecommitdiffstats
path: root/test.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-17 19:11:50 +0200
committerMattias Andrée <m@maandree.se>2026-05-17 19:12:48 +0200
commit70001dac8edaa045d72adbf2c1e68aea2429dc0a (patch)
tree18a1999aa2823d507cf78a829b694c2849968e86 /test.c
parentAdd __AARCH64EL__ (diff)
downloadlibblake-70001dac8edaa045d72adbf2c1e68aea2429dc0a.tar.gz
libblake-70001dac8edaa045d72adbf2c1e68aea2429dc0a.tar.bz2
libblake-70001dac8edaa045d72adbf2c1e68aea2429dc0a.tar.xz
Fix clang-sanitizer complaints on test code
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--test.c6
1 files changed, 4 insertions, 2 deletions
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, &params);
*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, &params);
*outlen = hashlen;