linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Theil <markus.theil@tu-ilmenau.de>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Markus Theil <markus.theil@tu-ilmenau.de>
Subject: [PATCH 3/8] iw: scan: fix buffer over-read in operation class parsing
Date: Sun,  9 Feb 2020 17:58:57 +0100	[thread overview]
Message-ID: <20200209165902.44110-4-markus.theil@tu-ilmenau.de> (raw)
In-Reply-To: <20200209165902.44110-1-markus.theil@tu-ilmenau.de>

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 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;
-- 
2.25.0


  parent reply	other threads:[~2020-02-09 16:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09 16:58 [PATCH 0/8] iw: parse measurement pilot and fix scan bugs Markus Theil
2020-02-09 16:58 ` [PATCH 1/8] iw: scan: parse measurement pilot element Markus Theil
2020-02-09 16:58 ` [PATCH 2/8] iw: scan: fix buffer over-read in print_ies() Markus Theil
2020-02-09 16:58 ` Markus Theil [this message]
2020-02-09 16:58 ` [PATCH 4/8] iw: scan: fix buffer over-read in parsing roaming consortium Markus Theil
2020-02-09 16:58 ` [PATCH 5/8] iw: scan: fix buffer over-read in print_wifi_wps Markus Theil
2020-02-09 16:59 ` [PATCH 6/8] iw: scan: fix buffer over-read in print_p2p Markus Theil
2020-02-09 16:59 ` [PATCH 7/8] iw: scan: fix undefined behaviour in rm capa print Markus Theil
2020-02-09 16:59 ` [PATCH 8/8] iw: scan: fix undefined behaviour in print_vht_capa() Markus Theil
2020-02-10  8:11 ` [PATCH 0/8] iw: parse measurement pilot and fix scan bugs Johannes Berg
2020-02-10  8:22   ` Markus Theil
2020-02-11 10:12     ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200209165902.44110-4-markus.theil@tu-ilmenau.de \
    --to=markus.theil@tu-ilmenau.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).