1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

hash: murmur: Initialize final hash explicitly

Signed-off-by: Anatol Belski <ab@php.net>
This commit is contained in:
Anatol Belski
2020-11-03 15:33:52 +01:00
parent b43c455b98
commit 4b3438d8ce

View File

@@ -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);