[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 02/02: sha256_update(): added shortcut for
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 02/02: sha256_update(): added shortcut for empty data, avoid wrong/undefined behaviour of memcpy() with null pointer |
Date: |
Fri, 19 Apr 2019 09:36:03 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 78a903946d707cab78c5eb996312deccb3f68c82
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Fri Apr 19 10:35:35 2019 +0300
sha256_update(): added shortcut for empty data,
avoid wrong/undefined behaviour of memcpy() with null pointer
---
src/microhttpd/sha256.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/microhttpd/sha256.c b/src/microhttpd/sha256.c
index 2c3c057d..e3989d57 100644
--- a/src/microhttpd/sha256.c
+++ b/src/microhttpd/sha256.c
@@ -250,6 +250,9 @@ sha256_update (void *ctx_,
mhd_assert((data != NULL) || (length == 0));
+ if (0 == length)
+ return; /* Do nothing */
+
/* Note: (count & (SHA256_BLOCK_SIZE-1))
equal (count % SHA256_BLOCK_SIZE) for this block size. */
bytes_have = (unsigned)(ctx->count & (SHA256_BLOCK_SIZE-1));
--
To stop receiving notification emails like this one, please contact
address@hidden