Skip to content

Fix handling of 32-character SSID strings when scanning for access points on Esp8266 - #3032

Merged
slaff merged 1 commit into
SmingHub:developfrom
mikee47:fix/esp8266-ap-scan-ssid
Jul 13, 2026
Merged

Fix handling of 32-character SSID strings when scanning for access points on Esp8266#3032
slaff merged 1 commit into
SmingHub:developfrom
mikee47:fix/esp8266-ap-scan-ssid

Conversation

@mikee47

@mikee47 mikee47 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a bug when scanning for access points on the Esp8266.

The code currently assumes that the SSID is NUL-terminated, but this cannot be relied upon.

I today started getting weird behaviour sending the network list over a websocket connection in JSON format.
If any of the JSON is malformed then the browser closes the connection.

The offending SSID was this:

44 49 52 45 43 54 2d 43 46 2d 48 50 20 44 65 73  DIRECT-CF-HP Des
6b 4a 65 74 20 32 39 30 30 20 73 65 72 69 65 73  kJet 2900 series
20 06 be                                          ..

The SSID buffer is only 32 characters long so the 20 06 be is junk which is not part of the name.
Clearly the ssid_len should have been used: we cannot assume SSID is NUL-terminated.

@SmingHub SmingHub deleted a comment from what-the-diff Bot Jul 12, 2026
@slaff
slaff merged commit 4fd3a2b into SmingHub:develop Jul 13, 2026
31 checks passed
@slaff slaff added this to the 6.3.0 milestone Jul 13, 2026
@mikee47
mikee47 deleted the fix/esp8266-ap-scan-ssid branch July 16, 2026 14:53
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.

2 participants