aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorRujun Wang <chinawrj@gmail.com>2016-04-25 01:01:44 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-13 15:25:47 (GMT)
commit46bac6520de66f6e22fad7ee8b7f4b5d80176758 (patch)
treeb9243125c7e96ee73e6d1fa4382868b51f31f427 /src/wps
parente4471338c6556f4e60f4aca1313df2f6c52497c6 (diff)
downloadhostap-46bac6520de66f6e22fad7ee8b7f4b5d80176758.zip
hostap-46bac6520de66f6e22fad7ee8b7f4b5d80176758.tar.gz
hostap-46bac6520de66f6e22fad7ee8b7f4b5d80176758.tar.bz2
WPS: Fix segmentation fault in new DH key derivation
Commit 4104267e81b0a0acdb43f693a67f236b3237a719 ('Fix memory leak on NFC DH generation error path') modified dh5_init() behavior in the non-OpenSSL implementation to free the public key (if any was previously set). However, this did not update one of the callers to make sure the publ argument in the call is initialized. This could result in trying to free invalid pointer and segmentation fault when hostapd or wpa_supplicant was built against some other crypto library than OpenSSL. Signed-off-by: Rujun Wang <chinawrj@gmail.com>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps_attr_build.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wps/wps_attr_build.c b/src/wps/wps_attr_build.c
index c3befc4..2efc27e 100644
--- a/src/wps/wps_attr_build.c
+++ b/src/wps/wps_attr_build.c
@@ -20,7 +20,7 @@
int wps_build_public_key(struct wps_data *wps, struct wpabuf *msg)
{
- struct wpabuf *pubkey;
+ struct wpabuf *pubkey = NULL;
wpa_printf(MSG_DEBUG, "WPS: * Public Key");
wpabuf_clear_free(wps->dh_privkey);