* [PATCH 2/2] iw: fix ftm_request missing arguments segfault
@ 2021-03-22 14:55 Benjamin Aschenbrenner
2021-04-08 8:13 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Aschenbrenner @ 2021-03-22 14:55 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless
From: Benjamin Aschenbrenner <benjamin.aschenbrenner@gmail.com>
Date: Mon, 22 Mar 2021 15:19:00 +0100
Subject: [PATCH 2/2] iw: fix ftm_request missing arguments segfault
When expected argument <config-file> is not passed to arguemts iw
segfaults.
Example: iw wlp2s0 measurement ftm_request
This fixes it.
Signed-off-by: Benjamin Aschenbrenner <benjamin.aschenbrenner@gmail.com>
---
measurements.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/measurements.c b/measurements.c
index 635d942..80fe785 100644
--- a/measurements.c
+++ b/measurements.c
@@ -282,6 +282,9 @@ static int handle_ftm_req_send(struct
nl80211_state *state, struct nl_msg *msg,
const char *file;
int err;
+ if (argc < 1)
+ return HANDLER_RET_USAGE;
+
file = argv[0];
argc--;
argv++;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-10 11:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 14:55 [PATCH 2/2] iw: fix ftm_request missing arguments segfault Benjamin Aschenbrenner
2021-04-08 8:13 ` Johannes Berg
2021-04-10 11:14 ` Benjamin Aschenbrenner
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).