]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Avoid calling hash update with NULL input (and zero length)
authorZoltan Fridrich <zfridric@redhat.com>
Sat, 24 Sep 2022 08:56:31 +0000 (10:56 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Sat, 24 Sep 2022 08:56:31 +0000 (10:56 +0200)
balloon.c

index 75240ab4c2e918ba85efa37e3aed9b7a53bed194..d135ee86d4a74af3dbf019ecce25a92f46c0b522 100644 (file)
--- 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);
 }