com php-src: hash: murmur: Initialize final hash explicitly: ext/hash/hash_murmur.c
| From: | Anatol Belski | Date: | Tue, 03 Nov 2020 17:41:39 +0000 |
| Subject: | com php-src: hash: murmur: Initialize final hash explicitly: ext/hash/hash_murmur.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-114054@lists.php.net to get a copy of this message | ||
Commit: 4b3438d8ce3bc51d05dc12ff0abdcc322708c39d
Author: Anatol Belski <ab@php.net> Tue, 3 Nov 2020 15:33:52 +0100
Parents: b43c455b983c7ebb7f9044376902cf85b0fb790f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4b3438d8ce3bc51d05dc12ff0abdcc322708c39d
Log:
hash: murmur: Initialize final hash explicitly
Signed-off-by: Anatol Belski <ab@php.net>
Changed paths:
M ext/hash/hash_murmur.c
Diff:
diff --git a/ext/hash/hash_murmur.c b/ext/hash/hash_murmur.c
index 8d49ed47cd4..ab01b4f19fc 100644
--- a/ext/hash/hash_murmur.c
+++ b/ext/hash/hash_murmur.c
@@ -97,7 +97,7 @@ PHP_HASH_API void PHP_MURMUR3CUpdate(PHP_MURMUR3C_CTX *ctx, const unsigned char
PHP_HASH_API void PHP_MURMUR3CFinal(unsigned char digest[4], PHP_MURMUR3C_CTX *ctx)
{
- uint32_t h[4] = {0};
+ uint32_t h[4] = {0, 0, 0, 0};
PMurHash128x86_Result(ctx->h, ctx->carry, ctx->len, h);
digest[0] = (unsigned char)((h[0] >> 24) & 0xff);
@@ -156,7 +156,7 @@ PHP_HASH_API void PHP_MURMUR3FUpdate(PHP_MURMUR3F_CTX *ctx, const unsigned char
PHP_HASH_API void PHP_MURMUR3FFinal(unsigned char digest[4], PHP_MURMUR3F_CTX *ctx)
{
- uint64_t h[2] = {0};
+ uint64_t h[2] = {0, 0};
PMurHash128x64_Result(ctx->h, ctx->carry, ctx->len, h);
digest[0] = (unsigned char)((h[0] >> 56) & 0xff);