From: John Crispin Date: Fri, 17 May 2019 19:29:51 +0000 (+0200) Subject: iw: fix endless loop inside handle_mgmt_dump X-Git-Tag: v5.3~17 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fiw.git;a=commitdiff_plain;h=2f31605db4ffe5d90f84f731fdfa91f209aa2d98 iw: fix endless loop inside handle_mgmt_dump passing -1 will break the while loop further down in the code. Signed-off-by: John Crispin Signed-off-by: Johannes Berg --- diff --git a/mgmt.c b/mgmt.c index 88fe3fd..338435d 100644 --- a/mgmt.c +++ b/mgmt.c @@ -109,6 +109,8 @@ static int handle_mgmt_dump(struct nl80211_state *state, for (i = 3; i < argc; i += 3) { if (strcmp(argv[i], "count") == 0) { count = 1 + atoi(argv[i + 1]); + if (count < 1) + count = 1; break; }