]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make time_adv use easier for static analyzers
authorJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 20:45:16 +0000 (22:45 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 13 Nov 2011 20:45:16 +0000 (22:45 +0200)
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 <j@w1.fi>

src/ap/ieee802_11_shared.c

index 403856341dd8d8a701d1c39cb16eb0b3faf286df..c447bce8049b3a462224db79fd5f76710c11e40b 100644 (file)
@@ -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);