aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshok Ponnaiah <aponnaia@codeaurora.org>2018-03-05 05:29:18 (GMT)
committerJouni Malinen <j@w1.fi>2018-03-19 17:08:34 (GMT)
commitf5701cc66e5a5f236735952029b0e61bb78a0977 (patch)
treea9d5cc02b2d61cac2b6d3bfcb637e62cdee73f72
parentebe61e564c19fb6319bd7f31aa6f0593858090d6 (diff)
downloadhostap-f5701cc66e5a5f236735952029b0e61bb78a0977.zip
hostap-f5701cc66e5a5f236735952029b0e61bb78a0977.tar.gz
hostap-f5701cc66e5a5f236735952029b0e61bb78a0977.tar.bz2
OWE: Clean up pointer check in a testing code path
Check wpa_auth_write_assoc_resp_owe() return value to keep static analyzers happier. The code path where this could happen is not really reachable due to the separate hapd->conf->own_ie_override check and wpa_auth_write_assoc_resp_owe() returning NULL only in an error case in the override path. Furthermore, clean up the pointer return value to use a proper pointer (NULL vs. 0). Signed-off-by: Ashok Ponnaiah <aponnaia@codeaurora.org>
-rw-r--r--src/ap/ieee802_11.c2
-rw-r--r--src/ap/wpa_auth_ie.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index fcfe336..ec57f32 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -3021,7 +3021,7 @@ u8 * owe_assoc_req_process(struct hostapd_data *hapd, struct sta_info *sta,
owe_buf = wpa_auth_write_assoc_resp_owe(sta->wpa_sm, owe_buf,
owe_buf_len, NULL, 0);
- if (sta->owe_ecdh) {
+ if (sta->owe_ecdh && owe_buf) {
struct wpabuf *pub;
pub = crypto_ecdh_get_pubkey(sta->owe_ecdh, 0);
diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c
index 28db952..e4610d1 100644
--- a/src/ap/wpa_auth_ie.c
+++ b/src/ap/wpa_auth_ie.c
@@ -1042,7 +1042,7 @@ u8 * wpa_auth_write_assoc_resp_owe(struct wpa_state_machine *sm,
#ifdef CONFIG_TESTING_OPTIONS
if (conf->own_ie_override_len) {
if (max_len < conf->own_ie_override_len)
- return 0;
+ return NULL;
wpa_hexdump(MSG_DEBUG, "WPA: Forced own IE(s) for testing",
conf->own_ie_override, conf->own_ie_override_len);
os_memcpy(pos, conf->own_ie_override,