summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2017-03-20 17:29:28 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2020-05-23 15:31:14 +0200
commit712e8debb5b2238450b303acb5f24298382c63a5 (patch)
treefbcbc73a1b34465cee2c4ab6199c3ae2a1ad9384 /crypto
parent2de64666a07cccf8477e6483de62ae31f463df64 (diff)
Fix the parameter types of the CRYPTO_EX_dup function type.
This fixes a strict aliasing issue in ui_dup_method_data. The parameter type of CRYPTO_EX_dup's from_d parameter is in fact void **, since it points to a pointer. This function is rarely used, therefore fix the param type although that may be considered an API breaking change. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2986)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/ex_data.c2
-rw-r--r--crypto/ui/ui_util.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/crypto/ex_data.c b/crypto/ex_data.c
index 6200d05529..80a136164a 100644
--- a/crypto/ex_data.c
+++ b/crypto/ex_data.c
@@ -96,7 +96,7 @@ static void dummy_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx,
}
static int dummy_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
- void *from_d, int idx,
+ void **from_d, int idx,
long argl, void *argp)
{
return 1;
diff --git a/crypto/ui/ui_util.c b/crypto/ui/ui_util.c
index f64780a6a2..6ca5706ea5 100644
--- a/crypto/ui/ui_util.c
+++ b/crypto/ui/ui_util.c
@@ -71,9 +71,8 @@ static void ui_new_method_data(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
}
static int ui_dup_method_data(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
- void *from_d, int idx, long argl, void *argp)
+ void **pptr, int idx, long argl, void *argp)
{
- void **pptr = (void **)from_d;
if (*pptr != NULL)
*pptr = OPENSSL_memdup(*pptr, sizeof(struct pem_password_cb_data));
return 1;