Skip to content

wifi_sta_list_t should be zero'ed before use #10287

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

Closed
1 task done
TD-er opened this issue Sep 4, 2024 · 1 comment
Closed
1 task done

wifi_sta_list_t should be zero'ed before use #10287

TD-er opened this issue Sep 4, 2024 · 1 comment
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@TD-er
Copy link
Contributor

TD-er commented Sep 4, 2024

Board

Any

Device Description

Hardware Configuration

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

Windows 11

Flash frequency

Any

PSRAM enabled

yes

Upload speed

115200

Description

As a follow-up of #10281 and as discussed with @me-no-dev

The wifi_sta_list_t struct has been extended recently and just to be sure no member is left in an undefined state, we should zero the entire struct before use.
The array of wifi_sta_info_t objects internally is filled via some get function from IDF, but I can't see if all are always filled.

wifi_sta_list_t is being used multiple times in AP.cpp, for example here:

wifi_sta_list_t clients;

Sketch

-

Debug Message

-

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@TD-er TD-er added the Status: Awaiting triage Issue is waiting for triage label Sep 4, 2024
@me-no-dev
Copy link
Member

this is not necessary here, because we are giving the struct to IDF to fill and not read from it. Zeroing is necessary only when data will be read in IDF. Like configs and such

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

2 participants