public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Daniel Bond <danielbondno@gmail.com>
To: prestwoj@gmail.com
Cc: danielbondno@gmail.com, denkenz@gmail.com, iwd@lists.linux.dev
Subject: [PATCH] scan: add guard to check that results->sr is set to avoid segfault issue.
Date: Tue,  3 Sep 2024 21:27:14 +0200	[thread overview]
Message-ID: <20240903192714.6922-1-danielbondno@gmail.com> (raw)
In-Reply-To: <32229467-dd4d-4207-af4e-e537500e663b@gmail.com>

Patch created by loqs in Archlinux issue: https://gitlab.archlinux.org/archlinux/packaging/packages/iwd/-/issues/5

As mentioned in list: https://lore.kernel.org/iwd/4083bf62-20d2-46e6-bfae-c926c2acbfe9@gmail.com/
---
 src/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scan.c b/src/scan.c
index debdeb1f..e5360d1b 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -2056,7 +2056,7 @@ static void get_survey_done(void *user_data)
 
 	sc->get_survey_cmd_id = 0;
 
-	if (!results->sr->canceled)
+	if (results->sr && !results->sr->canceled)
 		get_results(results);
 	else
 		get_scan_done(user_data);
-- 
2.46.0


  reply	other threads:[~2024-09-03 19:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02  6:34 [PATCH 1/2] scan: fix invalid read when canceling an ongoing scan Daniel Bond
2024-09-03 11:44 ` James Prestwood
2024-09-03 17:03   ` Daniel Bond
2024-09-03 18:04     ` James Prestwood
2024-09-03 19:27       ` Daniel Bond [this message]
2024-09-05  3:23   ` Denis Kenzior
2024-09-05 11:55     ` James Prestwood

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=20240903192714.6922-1-danielbondno@gmail.com \
    --to=danielbondno@gmail.com \
    --cc=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.com \
    /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