Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
[nrf noup] zephyr: Fix NULL de-reference
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
krish2718 committed May 8, 2024
1 parent b33e82e commit 3ac5008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wpa_supplicant/wpa_cli_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3ac5008

Please sign in to comment.