Search Linux Wireless

[PATCH] iw: connect: Fix segfault during open authentication

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

 



The check for remaining arguments is done after decrement effectively
bypassing the non-zero check and causes a segfault with below command:

  "connect <SSID> auth open/shared".

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@xxxxxxxxxxxxx>
---
 connect.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/connect.c b/connect.c
index e5b177f..33e1a5f 100644
--- a/connect.c
+++ b/connect.c
@@ -77,6 +77,9 @@ static int iw_conn(struct nl80211_state *state,
 	if (argc && strcmp(*argv, "key") != 0 && strcmp(*argv, "keys") != 0)
 		return 1;
 
+	if (!argc)
+		return 0;
+
 	argv++;
 	argc--;
 
-- 
2.34.1




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

  Powered by Linux