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

Fix socket resp handling #131

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

krish2718
Copy link
Collaborator

No description provided.

fixup! [nrf noup] zephyr: Add support for WPA CLI zephyr

As length is output of number of bytes received from socket we should
handle zero bytes as well, since we use stream sockets this happens when
the other end is shutdown.

Without this fix in a resource constrained envrionment len can become
zero and as its unsigned it overflows causing a crash.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
fixup! [nrf noup] zephyr: Add support for WPA CLI zephyr

sscanf is used on the response buffer which expects NULL terminated
buffers.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Copy link
Contributor

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a mental note to the team, we need to remember to port these to upstream when the time comes.

wpa_supplicant/wpa_cli_zephyr.c Outdated Show resolved Hide resolved
fixup! [nrf noup] zephyr: Add support for WPA CLI zephyr

Print only non-empty responses.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
@krish2718 krish2718 merged commit 20f5017 into nrfconnect:main Nov 9, 2023
1 check passed
@krish2718 krish2718 deleted the fix_socket_resp_handling branch November 9, 2023 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants