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

wifi_ap_record_t should be zero'ed before use #10286

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

wifi_ap_record_t should be zero'ed before use #10286

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_ap_record_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 just as has been done in PR #10282

Suggested fix, to zero all of _scanResult right after this line:

WiFiScanClass::_scanResult = new wifi_ap_record_t[WiFiScanClass::_scanCount];

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 also does not need to zero the structure, because it will be filled by IDF. However, the way that the next if is written, it is possible to leak the structure if IDF fails for some reason. So I will fix that instead :)

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