Search Linux Wireless

[PATCH] iw: Fix segfault when no args are given to offchannel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The offchannel command assumes that frequency and duration
are given as arguments, otherwise iw segfaults - fix that
by printing help text instead.

Signed-off-by: Ola Olsson <ola.olsson@xxxxxxxxxxxxxx>
---
 offch.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/offch.c b/offch.c
index 49b101a..04bf4c6 100644
--- a/offch.c
+++ b/offch.c
@@ -15,6 +15,10 @@ static int offchannel(struct nl80211_state *state,
 {
 	char *end;
 
+	if (argc < 2) {
+		return 1;
+	}
+
 	/* freq */
 	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ,
 		    strtoul(argv[0], &end, 10));
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux