From 41822b9b83df19bfc8f70be74bf9f42a0f76469a Mon Sep 17 00:00:00 2001 From: hanwckf Date: Mon, 1 Jan 2024 14:42:29 +0800 Subject: [PATCH] iwinfo: sanity check for iwrange ioctl --- package/network/utils/iwinfo/src/iwinfo_mtk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/network/utils/iwinfo/src/iwinfo_mtk.c b/package/network/utils/iwinfo/src/iwinfo_mtk.c index ae96a23bf1..5aa0c3317f 100644 --- a/package/network/utils/iwinfo/src/iwinfo_mtk.c +++ b/package/network/utils/iwinfo/src/iwinfo_mtk.c @@ -620,6 +620,9 @@ static int mtk_get_freqlist(const char *dev, char *buf, int *len) if (!ifname) return -1; + if (!mtk_is_ifup(ifname)) + return -1; + wrq.u.data.pointer = (caddr_t) ⦥ wrq.u.data.length = sizeof(struct iw_range); wrq.u.data.flags = 0;