From patchwork Sun Feb 9 16:58:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 11372185 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 965C7109A for ; Sun, 9 Feb 2020 16:59:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7250220726 for ; Sun, 9 Feb 2020 16:59:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727848AbgBIQ7P (ORCPT ); Sun, 9 Feb 2020 11:59:15 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:49169 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbgBIQ7P (ORCPT ); Sun, 9 Feb 2020 11:59:15 -0500 Received: from isengard.fritz.box (unknown [84.174.247.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 77DFE580073; Sun, 9 Feb 2020 17:59:13 +0100 (CET) From: Markus Theil To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Markus Theil Subject: [PATCH 3/8] iw: scan: fix buffer over-read in operation class parsing Date: Sun, 9 Feb 2020 17:58:57 +0100 Message-Id: <20200209165902.44110-4-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200209165902.44110-1-markus.theil@tu-ilmenau.de> References: <20200209165902.44110-1-markus.theil@tu-ilmenau.de> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Markus Theil --- scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scan.c b/scan.c index 14138ca..2d11f81 100644 --- a/scan.c +++ b/scan.c @@ -1507,7 +1507,7 @@ static void print_supp_op_classes(const uint8_t type, uint8_t len, printf("\n"); printf("\t\t * current operating class: %d\n", *p); - while (p++ < next_data) { + while (++p < next_data) { if (*p == 130) { one_hundred_thirty_delimiter = 1; break; @@ -1519,11 +1519,11 @@ static void print_supp_op_classes(const uint8_t type, uint8_t len, printf("\t\t * operating class: %d\n", *p); } if (one_hundred_thirty_delimiter) - while (p++ < next_data) { + while (++p < next_data) { printf("\t\t * current operating class extension: %d\n", *p); } if (zero_delimiter) - while (p++ < next_data - 1) { + while (++p < next_data - 1) { printf("\t\t * operating class duple: %d %d\n", p[0], p[1]); if (*p == 0) break;