From 3ac5008029de16f83d585d2735768ada53c5b05e Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 7 May 2024 19:45:03 +0530 Subject: [PATCH] [nrf noup] zephyr: Fix NULL de-reference fixup! [nrf noup] zephyr: Fix failure processing of no-response commands Add a NULL check before accessing response and response can be NULL for most commands. Fixes SHEL-2755. 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 e65eea132..8a3cbdb94 100644 --- a/wpa_supplicant/wpa_cli_zephyr.c +++ b/wpa_supplicant/wpa_cli_zephyr.c @@ -80,7 +80,7 @@ static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print, printf("%s", buf); } - if (len > 1 && (strncmp(resp, "FAIL", 4) == 0)) { + if (resp && len > 1 && (strncmp(resp, "FAIL", 4) == 0)) { wpa_printf(MSG_ERROR, "Command failed: %s", resp); return -3; }