From 3c86c16d85128ff911e9e0b8e2e06cf8da85337b Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 6 Jan 2015 14:25:57 -0800 Subject: [PATCH] In hash drbg changed assignment to memcpy to fix strict aliasing warning. --- ctaocrypt/src/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctaocrypt/src/random.c b/ctaocrypt/src/random.c index 06e4bbee6..26fa7148e 100644 --- a/ctaocrypt/src/random.c +++ b/ctaocrypt/src/random.c @@ -232,7 +232,7 @@ static int Hash_gen(DRBG* drbg, byte* out, word32 outSz, const byte* V) return DRBG_FAILURE; } - checkBlock = *(word32*)drbg->digest; + XMEMCPY(&checkBlock, drbg->digest, sizeof(word32)); if (drbg->reseedCtr > 1 && checkBlock == drbg->lastBlock) { if (drbg->matchCount == 1) { return DRBG_CONT_FAILURE;