Skip to content

Commit 6352e9a

Browse files
committed
Backport 7d2ef3d into 7.4
As the data structures are public, the fix for 64-bit consists on replacing the blanket memcpy with individual assignments.
1 parent b3f07af commit 6352e9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/hash/hash_gost.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ PHP_HASH_API void PHP_GOSTFinal(unsigned char digest[32], PHP_GOST_CTX *context)
291291
GostTransform(context, context->buffer);
292292
}
293293

294-
memcpy(l, context->count, sizeof(context->count));
294+
l[0] = context->count[0];
295+
l[1] = context->count[1];
295296
Gost(context, l);
296297
memcpy(l, &context->state[8], sizeof(l));
297298
Gost(context, l);

0 commit comments

Comments
 (0)