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>
This commit is contained in:
Jouni Malinen 2011-11-13 22:45:16 +02:00
parent a5c696adb4
commit 4c8a333b54

View File

@ -323,6 +323,9 @@ u8 * hostapd_eid_time_adv(struct hostapd_data *hapd, u8 *eid)
hostapd_update_time_adv(hapd) < 0) hostapd_update_time_adv(hapd) < 0)
return eid; return eid;
if (hapd->time_adv == NULL)
return eid;
os_memcpy(eid, wpabuf_head(hapd->time_adv), os_memcpy(eid, wpabuf_head(hapd->time_adv),
wpabuf_len(hapd->time_adv)); wpabuf_len(hapd->time_adv));
eid += wpabuf_len(hapd->time_adv); eid += wpabuf_len(hapd->time_adv);