diff mbox series

[3/8] iw: scan: fix buffer over-read in operation class parsing

Message ID 20200209165902.44110-4-markus.theil@tu-ilmenau.de
State New
Headers show
Series [1/8] iw: scan: parse measurement pilot element | expand

Commit Message

Markus Theil Feb. 9, 2020, 4:58 p.m. UTC
Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 scan.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

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;