aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-02-23 12:03:59 (GMT)
committerJouni Malinen <j@w1.fi>2019-02-25 17:48:49 (GMT)
commitcc4cdefc7f78214bc11e71609d24ef564ce0a6c7 (patch)
tree994c499012af04cebfd3c054aadea64d6d506f1f
parenta9377bc380d870baed60ce6e29370e6df46cd037 (diff)
downloadhostap-cc4cdefc7f78214bc11e71609d24ef564ce0a6c7.zip
hostap-cc4cdefc7f78214bc11e71609d24ef564ce0a6c7.tar.gz
hostap-cc4cdefc7f78214bc11e71609d24ef564ce0a6c7.tar.bz2
UBSan: Avoid unnecessary warning
elems->mic might be NULL here, so do not try to decrement it by 2 even if the result is not used anywhere due to a latter check for elems->mic being NULL. mesh_rsn.c:646:20: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffe Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--wpa_supplicant/mesh_rsn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c
index 64fc52b..174011b 100644
--- a/wpa_supplicant/mesh_rsn.c
+++ b/wpa_supplicant/mesh_rsn.c
@@ -643,7 +643,7 @@ int mesh_rsn_process_ampe(struct wpa_supplicant *wpa_s, struct sta_info *sta,
size_t crypt_len;
const u8 *aad[] = { sta->addr, wpa_s->own_addr, cat };
const size_t aad_len[] = { ETH_ALEN, ETH_ALEN,
- (elems->mic - 2) - cat };
+ elems->mic ? (elems->mic - 2) - cat : 0 };
size_t key_len;
if (!sta->sae) {