From fac9222d3681044be5a4c3b6669cb324490ceed1 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 6 Dec 2023 01:38:27 +0530 Subject: [PATCH] [nrf noup] zephyr: Fix receive message length fixup! [nrf noup] Monitor supplicant state and inform applications Sender is sending the entire structure, and receiving one byte lesser results in two receive calls per-message, this screws up the message parsing. 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 8771ed420..91d22178a 100644 --- a/wpa_supplicant/wpa_cli_zephyr.c +++ b/wpa_supplicant/wpa_cli_zephyr.c @@ -115,7 +115,7 @@ static void wpa_cli_recv_pending(struct wpa_ctrl *ctrl) { while (wpa_ctrl_pending(ctrl) > 0) { char buf[sizeof(struct conn_msg)]; - size_t len = sizeof(buf) - 1; + size_t len = sizeof(buf); if (wpa_ctrl_recv(ctrl, buf, &len) == 0) { struct conn_msg *msg = (struct conn_msg *)buf;