From 8a36c5c2ca4d1f8a900ca3d9ffde40b96463def7 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Thu, 6 Dec 2018 05:04:28 +0000 Subject: Import wpa_supplicant/hostapd 2.7 --- src/tls/tlsv1_cred.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/tls/tlsv1_cred.c') diff --git a/src/tls/tlsv1_cred.c b/src/tls/tlsv1_cred.c index 52c1ae0143da3..842e5dd728c78 100644 --- a/src/tls/tlsv1_cred.c +++ b/src/tls/tlsv1_cred.c @@ -1166,10 +1166,9 @@ static int tlsv1_set_dhparams_der(struct tlsv1_credentials *cred, if (hdr.length == 0) return -1; os_free(cred->dh_p); - cred->dh_p = os_malloc(hdr.length); + cred->dh_p = os_memdup(hdr.payload, hdr.length); if (cred->dh_p == NULL) return -1; - os_memcpy(cred->dh_p, hdr.payload, hdr.length); cred->dh_p_len = hdr.length; pos = hdr.payload + hdr.length; @@ -1188,10 +1187,9 @@ static int tlsv1_set_dhparams_der(struct tlsv1_credentials *cred, if (hdr.length == 0) return -1; os_free(cred->dh_g); - cred->dh_g = os_malloc(hdr.length); + cred->dh_g = os_memdup(hdr.payload, hdr.length); if (cred->dh_g == NULL) return -1; - os_memcpy(cred->dh_g, hdr.payload, hdr.length); cred->dh_g_len = hdr.length; return 0; -- cgit v1.2.3