nl80211: Make sure scan frequency debug buffer is NUL terminated

In theory, os_snprintf() could have filled the buffer to the end and
while the pos variable would not have been incremented beyond that,
there would not necessarily be a NUL termination at the end. Force the
array to end in NUL just in case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2023-03-01 10:38:02 +02:00 committed by Jouni Malinen
parent 41d23254b9
commit f628e6b30e

View file

@ -1737,6 +1737,7 @@ static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted,
}
info->freqs = freqs;
info->num_freqs = num_freqs;
msg[sizeof(msg) - 1] = '\0';
wpa_printf(MSG_DEBUG, "nl80211: Scan included frequencies:%s",
msg);
}