aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-06-28 10:23:58 (GMT)
committerJouni Malinen <j@w1.fi>2012-06-28 10:23:58 (GMT)
commit5bb7ae1f0ccca1474d8972dab582d136fef8d65b (patch)
treedb70b7df37ac1f1253e2a8cb2bfefdecb93ffe55
parent0e3c16546b419fc95cd6c0e7131a9114c075f34b (diff)
downloadhostap-5bb7ae1f0ccca1474d8972dab582d136fef8d65b.zip
hostap-5bb7ae1f0ccca1474d8972dab582d136fef8d65b.tar.gz
hostap-5bb7ae1f0ccca1474d8972dab582d136fef8d65b.tar.bz2
WPS: Fix error case in NFC password token generation
Need to verify that wps_build_nfc_pw_token() returned a valid buffer before trying to encapsulate it for NDEF. Signed-hostap: Jouni Malinen <j@w1.fi>
-rw-r--r--wpa_supplicant/wps_supplicant.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index cd16e21..bade09f 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -1799,7 +1799,7 @@ struct wpabuf * wpas_wps_nfc_token(struct wpa_supplicant *wpa_s, int ndef)
ret = wps_build_nfc_pw_token(wpa_s->conf->wps_nfc_dev_pw_id,
wpa_s->conf->wps_nfc_dh_pubkey,
wpa_s->conf->wps_nfc_dev_pw);
- if (ndef) {
+ if (ndef && ret) {
struct wpabuf *tmp;
tmp = ndef_build_wifi(ret);
wpabuf_free(ret);