From f628e6b30e950963ac55232630e30d398d4badc7 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 1 Mar 2023 10:38:02 +0200 Subject: [PATCH] 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 --- src/drivers/driver_nl80211_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 3a2faf63e..cf31552c0 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -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); } -- 2.47.3