crypto/engine/eng_cryptodev.c: don't treat a void* like an array
authorRichard Levitte <levitte@openssl.org>
Wed, 14 Mar 2018 10:35:53 +0000 (11:35 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 14 Mar 2018 10:54:27 +0000 (11:54 +0100)
The void* needs to be cast to a char* first.

Fixes #5614

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5615)

crypto/engine/eng_cryptodev.c

index 7aae5ab5fd03ef2ce48ba580b0f64282f1e81f85..d8cac4bdfd318230b0090aba47244ad759653968 100644 (file)
@@ -1057,7 +1057,7 @@ static int crparam2bn(struct crparam *crp, BIGNUM *a)
         return (-1);
 
     for (i = 0; i < bytes; i++)
-        pd[i] = crp->crp_p[bytes - i - 1];
+        pd[i] = ((char *)crp->crp_p)[bytes - i - 1];
 
     BN_bin2bn(pd, bytes, a);
     free(pd);