Parcourir la source

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 <j@w1.fi>
Jouni Malinen il y a 13 ans
Parent
commit
4c8a333b54
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      src/ap/ieee802_11_shared.c

+ 3 - 0
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);