From 163da14252aaea6888dc6c8782536f48cd3fd92b Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 6 Dec 2023 01:36:35 +0530 Subject: [PATCH] [nrf noup] zephyr: Fix message buffer length fixup! [nrf noup] Monitor supplicant state and inform applications The incoming message is payload + length, so, need to include size of the "length" field. Fixes SHEL-2250. Signed-off-by: Chaitanya Tata --- wpa_supplicant/wpa_cli_zephyr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_cli_zephyr.c b/wpa_supplicant/wpa_cli_zephyr.c index b26243c14..8771ed420 100644 --- a/wpa_supplicant/wpa_cli_zephyr.c +++ b/wpa_supplicant/wpa_cli_zephyr.c @@ -114,7 +114,7 @@ static void wpa_cli_close_connection(struct wpa_supplicant *wpa_s) static void wpa_cli_recv_pending(struct wpa_ctrl *ctrl) { while (wpa_ctrl_pending(ctrl) > 0) { - char buf[MAX_CTRL_MSG_LEN]; + char buf[sizeof(struct conn_msg)]; size_t len = sizeof(buf) - 1; if (wpa_ctrl_recv(ctrl, buf, &len) == 0) {