Skip to content

Bound Wi-Fi scan results to fixed storage - #1853

Open
Distortions81 wants to merge 1 commit into
bitaxeorg:masterfrom
Distortions81:fix/wifi-scan-bounds-hardening
Open

Bound Wi-Fi scan results to fixed storage#1853
Distortions81 wants to merge 1 commit into
bitaxeorg:masterfrom
Distortions81:fix/wifi-scan-bounds-hardening

Conversation

@Distortions81

@Distortions81 Distortions81 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cap ESP-IDF scan retrieval at the existing 20-record storage limit.
  • Pass explicit destination capacity through wifi_scan() and clamp both copy boundaries.
  • Clear stale scan state on failure and terminate copied SSIDs.

Root cause and impact

The driver-reported AP total was reused as capacity for a fixed 20-entry global array, then reused for a fixed 20-entry HTTP stack array. A dense scan could write beyond both buffers. The endpoint still returns at most 20 networks; excess results are safely ignored.

This preserves the trusted-network design and adds no authentication or access control.

Related work

  • Wifi scan fix #690 previously corrected Wi-Fi scan behavior; this draft adds the missing fixed-capacity enforcement.
  • HTTP Handler Audit #1759 audited HTTP handlers; the second affected boundary is in the scan response handler.

Validation

  • git diff --check upstream/master...HEAD
  • ESP-IDF 6.0.2 connect component and ESP32-S3 test image built
  • Source review against the ESP-IDF scan API capacity contract
  • Current GitHub checks are green

A hardware scan with more than 20 visible APs remains desirable.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

  2 files    2 suites   1s ⏱️
120 tests 120 ✅ 0 💤 0 ❌
122 runs  122 ✅ 0 💤 0 ❌

Results for commit e541ddf.

@Distortions81
Distortions81 marked this pull request as ready for review August 7, 2026 22:30
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

Successfully merging this pull request may close these issues.

1 participant