summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2020-01-29 13:19:27 +0100
committerAnatol Belski <ab@php.net>2020-01-29 13:38:46 +0100
commit6352e9a98925d375d0c2d3d8b0de66966d9522fc (patch)
tree370c7fb2b013be23b76aa7f8f28cccc4285584ee
parentb3f07afabc32cef19c092524fd705ca1cbde566b (diff)
downloadphp-git-6352e9a98925d375d0c2d3d8b0de66966d9522fc.tar.gz
Backport 7d2ef3d2e540885dec26d91dad061bff1621ad07 into 7.4
As the data structures are public, the fix for 64-bit consists on replacing the blanket memcpy with individual assignments.
-rw-r--r--ext/hash/hash_gost.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c
index f51b310b70..ded6d1c6a7 100644
--- a/ext/hash/hash_gost.c
+++ b/ext/hash/hash_gost.c
@@ -291,7 +291,8 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context)
GostTransform(context, context->buffer);
}
- memcpy(l, context->count, sizeof(context->count));
+ l[0] = context->count[0];
+ l[1] = context->count[1];
Gost(context, l);
memcpy(l, &context->state[8], sizeof(l));
Gost(context, l);