From: Zoltan Fridrich Date: Sat, 24 Sep 2022 08:56:31 +0000 (+0200) Subject: Avoid calling hash update with NULL input (and zero length) X-Git-Tag: nettle_3.9_release_20230514~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5fc30a1ef490079102d96ccc6d883f933be23c2;p=thirdparty%2Fnettle.git Avoid calling hash update with NULL input (and zero length) --- diff --git a/balloon.c b/balloon.c index 75240ab4..d135ee86 100644 --- a/balloon.c +++ b/balloon.c @@ -61,8 +61,10 @@ hash(void *ctx, uint8_t tmp[8]; LE_WRITE_UINT64(tmp, cnt); update(ctx, sizeof(tmp), tmp); - update(ctx, a_len, a); - update(ctx, b_len, b); + if (a && a_len) + update(ctx, a_len, a); + if (b && b_len) + update(ctx, b_len, b); digest(ctx, digest_size, dst); }