mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-19 11:24:05 -05:00
AP: Avoid NULL use with snprintf string
identity_buf may be NULL here. Handle this case explicitly by printing "N/A" instead relying on snprintf converting this to "(null)" or some other value based on unexpected NULL pointer. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
parent
f6b5b6bb4f
commit
6bb9d9a8db
@ -2733,7 +2733,8 @@ int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
|
|||||||
wpa_auth_sta_key_mgmt(sta->wpa_sm))) ?
|
wpa_auth_sta_key_mgmt(sta->wpa_sm))) ?
|
||||||
1 : 2,
|
1 : 2,
|
||||||
(unsigned int) diff.sec,
|
(unsigned int) diff.sec,
|
||||||
sm->identity ? (char *) sm->identity : identity_buf);
|
sm->identity ? (char *) sm->identity :
|
||||||
|
(identity_buf ? identity_buf : "N/A"));
|
||||||
os_free(identity_buf);
|
os_free(identity_buf);
|
||||||
if (os_snprintf_error(buflen - len, ret))
|
if (os_snprintf_error(buflen - len, ret))
|
||||||
return len;
|
return len;
|
||||||
|
Loading…
Reference in New Issue
Block a user