2021-03-22 14:56:43

by Benjamin Aschenbrenner

[permalink] [raw]
Subject: [PATCH 2/2] iw: fix ftm_request missing arguments segfault

From: Benjamin Aschenbrenner <[email protected]>
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 <[email protected]>
---
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


2021-04-08 08:14:25

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 2/2] iw: fix ftm_request missing arguments segfault

On Mon, 2021-03-22 at 15:55 +0100, Benjamin Aschenbrenner wrote:
>
> @@ -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;

Something along the line replaced tabs by 4 spaces, so the patches don't
apply. Please resend.

Thanks,
johannes

2021-04-10 11:18:17

by Benjamin Aschenbrenner

[permalink] [raw]
Subject: Re: Re: [PATCH 2/2] iw: fix ftm_request missing arguments segfault

Sorry I missed that. Will resend as v2.

Kind regards,
Benjamin