public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 2/2] dpp: check for non-utf8 SSID's in scan results
Date: Thu, 16 Nov 2023 07:44:39 -0800	[thread overview]
Message-ID: <20231116154439.33880-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20231116154439.33880-1-prestwoj@gmail.com>

In theory this shouldn't be possible because the configuration object
validates that the SSID is utf-8. But it doesn't hurt to check
especially since we can't control what the kernel sends us.
---
 src/dpp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/dpp.c b/src/dpp.c
index 18b2a7c6..8da79603 100644
--- a/src/dpp.c
+++ b/src/dpp.c
@@ -884,6 +884,9 @@ static bool dpp_scan_results(int err, struct l_queue *bss_list,
 	/* Purely for grabbing the SSID */
 	bss = l_queue_peek_head(bss_list);
 
+	if (L_WARN_ON(!util_ssid_is_utf8(bss->ssid_len, bss->ssid)))
+		goto reset;
+
 	memcpy(ssid, bss->ssid, bss->ssid_len);
 	ssid[bss->ssid_len] = '\0';
 
-- 
2.34.1


  reply	other threads:[~2023-11-16 15:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 15:44 [PATCH 1/2] dpp: check that DPP is running in station watch James Prestwood
2023-11-16 15:44 ` James Prestwood [this message]
2023-11-16 15:51   ` [PATCH 2/2] dpp: check for non-utf8 SSID's in scan results Denis Kenzior
2023-11-16 15:52     ` James Prestwood
2023-11-16 15:48 ` [PATCH 1/2] dpp: check that DPP is running in station watch Denis Kenzior

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=20231116154439.33880-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /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