diff options
author | Zoltan Fridrich <zfridric@redhat.com> | 2022-09-24 10:56:31 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2022-09-24 10:56:31 +0200 |
commit | f5fc30a1ef490079102d96ccc6d883f933be23c2 (patch) | |
tree | c85c507d381161397b6160c1c8ccaf0a119eab41 | |
parent | 75722a2b8975dfc52c43bc12a6388b4eb8ec6ef6 (diff) | |
download | nettle-f5fc30a1ef490079102d96ccc6d883f933be23c2.tar.gz |
Avoid calling hash update with NULL input (and zero length)
-rw-r--r-- | balloon.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |