From 306cbc36b126c58e13e3435d27c5087ba1ba6e7a Mon Sep 17 00:00:00 2001 From: limao-cpu <141137643+limao-cpu@users.noreply.github.com> Date: Thu, 26 Jun 2025 17:18:37 +0800 Subject: [PATCH] iwinfo: fix uninitialized buffer in rpc_iwinfo_scan 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 --- iwinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/iwinfo.c b/iwinfo.c index ff0f38b7fa..8451faa906 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -382,6 +382,7 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, void *c, *d, *t; char mac[18]; char res[IWINFO_BUFSIZE]; + memset(res, 0, sizeof(res)); struct iwinfo_scanlist_entry *e; rv = rpc_iwinfo_open(msg);