From e6ac47b47db70c77b2631b7669165a01f4de2ca8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 15 Apr 2019 20:54:12 +0300 Subject: [PATCH] Fix debug print in GET_PREF_FREQ_LIST handler Do not use the buf argument to wpas_ctrl_iface_get_pref_freq_list() in the debug print since it points to the response buffer ("OK\n" without null termination). This was supposed to print the cmd argument instead. The previous version ended up using uninitialized heap memory from the response buffer. Fixes: 983422088f00 ("nl80211: Add means to query preferred channels") Signed-off-by: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 564f32b85..198ac562d 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -7715,7 +7715,7 @@ static int wpas_ctrl_iface_get_pref_freq_list( wpa_printf(MSG_DEBUG, "CTRL_IFACE: GET_PREF_FREQ_LIST iface_type=%d (%s)", - iface_type, buf); + iface_type, cmd); ret = wpa_drv_get_pref_freq_list(wpa_s, iface_type, &num, freq_list); if (ret)