All of lore.kernel.org
 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 7/8] iw: scan: fix undefined behaviour in rm capa print
Date: Sun,  9 Feb 2020 17:59:01 +0100	[thread overview]
Message-ID: <20200209165902.44110-8-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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scan.c b/scan.c
index b3e7baa..e2a620a 100644
--- a/scan.c
+++ b/scan.c
@@ -586,10 +586,10 @@ static void print_rm_enabled_capabilities(const uint8_t type, uint8_t len,
 			    const uint8_t *data,
 			    const struct print_ies_data *ie_buffer)
 {
-	__u64 capa = data[0] |
-		     data[1] << 8 |
-		     data[2] << 16 |
-		     data[3] << 24 |
+	__u64 capa = ((__u64) data[0]) |
+		     ((__u64) data[1]) << 8 |
+		     ((__u64) data[2]) << 16 |
+		     ((__u64) data[3]) << 24 |
 		     ((__u64) data[4]) << 32;
 
 	printf("\n");
-- 
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 ` [PATCH 3/8] iw: scan: fix buffer over-read in operation class parsing Markus Theil
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 ` Markus Theil [this message]
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-8-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.