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
1 changed files with 2 additions and 1 deletions
|
@ -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))) ?
|
||||
1 : 2,
|
||||
(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);
|
||||
if (os_snprintf_error(buflen - len, ret))
|
||||
return len;
|
||||
|
|
Loading…
Reference in a new issue