Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WhdSTAInterface::set_timeout(_timeout) crashes: 0239-WHD-add-join-timeout-parameter-to-WiFiSTAInterface-a.patch has a bug. #1008

Open
dac1e opened this issue Dec 24, 2024 · 1 comment

Comments

@dac1e
Copy link

dac1e commented Dec 24, 2024

0239-WHD-add-join-timeout-parameter-to-WiFiSTAInterface-a.patch has a bug.

This patch introduced the override of a new function 'nsapi_error_t set_timeout(uint32_t timeout)'.

The function in the patch file has no return value and looks as follows:

nsapi_error_t set_timeout(uint32_t timeout)
{
_timeout = timeout;
}

It should look as follows:

nsapi_error_t set_timeout(uint32_t timeout)
{
_timeout = timeout;
return NSAPI_ERROR_OK;
}

When I run the WifiAdvanceChatServer example on Arduino Giga, the function call

wifi_if->set_timeout(_timeout);

in line 78 of library file Wifi.cpp crashed.
The function set_timeout(uint32_t timeout) didn't return and rather fell through into the
implementation of

nsapi_error_t WhdSTAInterface::connect(
const char *ssid, const char *pass,
nsapi_security_t security,
uint8_t channel)

which crashed, because the function accessed random parameter values.

@dac1e dac1e changed the title 0239-WHD-add-join-timeout-parameter-to-WiFiSTAInterface-a.patch has a bug. WhdSTAInterface::set_timeout(_timeout) crashes: 0239-WHD-add-join-timeout-parameter-to-WiFiSTAInterface-a.patch has a bug. Dec 24, 2024
@pennam
Copy link
Contributor

pennam commented Jan 7, 2025

@dac1e Thanks. I've created a PR to fix this bug #1012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants