From 4c8a333b54764d6b6f38770c4668cf2bfb84da92 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 13 Nov 2011 22:45:16 +0200 Subject: [PATCH] Make time_adv use easier for static analyzers hapd->time_adv cannot really be NULL if hostapd_update_time_adv() returns success, but this construction seems to be too difficult for some static analyzers. While this change is not really needed in practice, it makes it easier to go through warnings from such analyzers. Signed-hostap: Jouni Malinen --- src/ap/ieee802_11_shared.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c index 403856341..c447bce80 100644 --- a/src/ap/ieee802_11_shared.c +++ b/src/ap/ieee802_11_shared.c @@ -323,6 +323,9 @@ u8 * hostapd_eid_time_adv(struct hostapd_data *hapd, u8 *eid) hostapd_update_time_adv(hapd) < 0) return eid; + if (hapd->time_adv == NULL) + return eid; + os_memcpy(eid, wpabuf_head(hapd->time_adv), wpabuf_len(hapd->time_adv)); eid += wpabuf_len(hapd->time_adv);