Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2214728yba; Fri, 17 May 2019 12:37:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUsZtG6UrDtoZ34Z0kBeMIg48roXhuHzSyuGYLHjxq+EY79/54GXI+EGwEF++Zoi4iNMBA X-Received: by 2002:a17:902:b606:: with SMTP id b6mr60099117pls.100.1558121834068; Fri, 17 May 2019 12:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558121834; cv=none; d=google.com; s=arc-20160816; b=gHb9e0Q+14otpDmzZBH3iaVRtVT5QewW4zLgEGc13p+Vd0GP4AgAdVGA79zTinkL6c oMR8VVjnFMVcOqkA3//R1yDsUQxiZTEFoNObNk1e0NHovoxfuwaaQWX/O1sj2uG4iti5 njRf/d52lV6XpyuwaxNpZw850AkugU6BFsUKzvmkATX+1T4iKUYD2r1GknbqqONSFchx aa5ECjeNQVNrEBuFXVVA9VDr1JE8r8LLKLYRFxh5gOICLhNHIjpze6+Xh48FS1Nl6ts1 uffKV01WStNpxhweEyFLk5cK9UiwqWtDpZIwCLVBdyfa4ubdXwJ/zJrHaHusKiaMl5fW iMbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yfXBkk7YSm1PMqp3FceEvE5V+eJ+9+o1wIHbbBKJTFo=; b=ApKi3Yc3Zvyac+5fFuGt3kYkEezAFoOLlAaxkwP4CEKEbKy47Z2KqS351kM9w3g+F6 06ewDwKBK3chXaDugjEgqKVyxMfe9vQxbYWKiPjgSVz/hAvYZVMkmuCm/q7GQQIdZ3Az jyueCHA6m5fHovsWvmXTOTv787wE0JWnGokMobTgFGXGX4D+Jre0W75lkdPLwwCqs3Bs oZ5DCqI7QSM1aKFAOKVf01NxzVRjMZE0wtjJ32dFlpyECbpLUFVrXtL5Oi+SJfm+Hcz2 Um+/LGV5FBUzJ9JrBOhvc7jouDBv8x280Q03pL0Ws66G6qXgeA8K/EmFuyJRcK7lR3nA mdsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si9687960pfn.256.2019.05.17.12.36.59; Fri, 17 May 2019 12:37:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728958AbfEQTaf (ORCPT + 99 others); Fri, 17 May 2019 15:30:35 -0400 Received: from nbd.name ([46.4.11.11]:37374 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728954AbfEQTa3 (ORCPT ); Fri, 17 May 2019 15:30:29 -0400 Received: from p548c8c9f.dip0.t-ipconnect.de ([84.140.140.159] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hRiYk-0006cc-TJ; Fri, 17 May 2019 21:30:27 +0200 From: John Crispin To: Johannes Berg Cc: linux-wireless@vger.kernel.org, John Crispin Subject: [PATCH 2/7] iw: fix endless loop inside handle_mgmt_dump Date: Fri, 17 May 2019 21:29:51 +0200 Message-Id: <20190517192956.18372-3-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190517192956.18372-1-john@phrozen.org> References: <20190517192956.18372-1-john@phrozen.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org passing -1 will break the while loop further down in the code. Signed-off-by: John Crispin --- mgmt.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.20.1