Skip to content

Conversation

@limao-cpu
Copy link

The buffer res in rpc_iwinfo_scan() was previously uninitialized before being passed to iw->scanlist(). If the scan result was shorter than previous data, or not fully written, residual data could lead to garbage or incorrect output.

This patch adds an explicit memset(res, 0, sizeof(res)); before the scan to ensure clean and consistent output, especially during repeated scans or partial data writes.

Tested on OpenWrt with multiple interface scans to confirm stability.

@limao-cpu
Copy link
Author

Thanks for the review!
Please take another look.

@systemcrash
Copy link
Contributor

Squash your commits
Use a real signed off email
use a subject line in the commit

The buffer 'res' was uninitialized before being passed to scanlist(),
which could lead to garbage data in scan results. This patch ensures
the buffer is zeroed out using memset before use.

Signed-off-by: limao-cpu <[email protected]>
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