From patchwork Mon Mar 22 14:55:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Aschenbrenner X-Patchwork-Id: 406457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB125C433E0 for ; Mon, 22 Mar 2021 14:56:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B9846192E for ; Mon, 22 Mar 2021 14:56:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbhCVOzo (ORCPT ); Mon, 22 Mar 2021 10:55:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbhCVOzc (ORCPT ); Mon, 22 Mar 2021 10:55:32 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C896C061574 for ; Mon, 22 Mar 2021 07:55:32 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id d10so8315007ils.5 for ; Mon, 22 Mar 2021 07:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=NkJHhEPuDaKXUGRD/9F779JBbJEyfcdNzitG5OgY/kk=; b=H/BFoGrSo4BxXK/BMfwXxHdVzTgE+RX8T9zI6iBVtXwNDC1QmPE0xk+5R/e5kBqEsO rajIc2LCemHx/8K4AS76ZTmKfr2DVXUwECtinUFm6k81LCuUKQZd4DzUbqeHdixgdBNQ 1IfcukXJVpVDNe6DqEau47u/ECxefy+DZYxb47t17iw0pS3p6fubMNmszAWzZCOQaTPV TdLE5Zq3H0mD0lXsD9EU4xMbG5A5BogMZVsHa67b3LF4e0pakndi1rdV2/Upg16W2qiU U86Nd4DLdB1kWT1IUyYX2B8ZPLlpIJnVhbu4/A/qczvsmpt2z9XFcXmnzP2os+bukMGd gbOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=NkJHhEPuDaKXUGRD/9F779JBbJEyfcdNzitG5OgY/kk=; b=PWAAsG55gH/aPf7s1FfRg7kcLn59rncaFAvzXEfYiVO8/6iXXM7kuuSf6F72ByL2FF Cdqs6xUYlDCXZxoqbpc1o9W6JGsR+lEft8Nzk0vzwfeOMlWg1SfXa3eMzb7Wn1yjsxw5 +5bOVY/vsLbwXavBwn6IMP3qFTa/Eh/tjc8ku7OcBdaq//WbW5NxL9Qw/L7M5HRclhaS Sub1yxdDdeESr9n0Dhe7M5mSVb76Le8JqLzHNB6mhnd8N4JCl5emJmiFpxixFODROB3H OnvWAx7FuZBBQ00BsoZ2eiWRevojRqosYSmpSd8XIYeHoEffGa45eoDl4IIGW1kgOFQQ InQA== X-Gm-Message-State: AOAM530vMYO52mCmtfpv0ullalfE6wLiMWI6emUHqm82WR7gqbidNujF HCWITwdEGXhJWsFOp+oOVe+AfWMEhS+rc2WQnaY2ODdKMFg= X-Google-Smtp-Source: ABdhPJzY8VxLL2G1zWYYSm2CrhO/GnqNWuUDRAOTxlpsu+kJZgiTjj7p+JdHZw1VdL4jsQAiD0aI4ghVWUPp2JjZO/8= X-Received: by 2002:a05:6e02:1baf:: with SMTP id n15mr369554ili.190.1616424931581; Mon, 22 Mar 2021 07:55:31 -0700 (PDT) MIME-Version: 1.0 From: Benjamin Aschenbrenner Date: Mon, 22 Mar 2021 15:55:20 +0100 Message-ID: Subject: [PATCH 2/2] iw: fix ftm_request missing arguments segfault To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Benjamin Aschenbrenner Date: Mon, 22 Mar 2021 15:19:00 +0100 Subject: [PATCH 2/2] iw: fix ftm_request missing arguments segfault When expected argument is not passed to arguemts iw segfaults. Example: iw wlp2s0 measurement ftm_request This fixes it. Signed-off-by: Benjamin Aschenbrenner --- measurements.c | 3 +++ 1 file changed, 3 insertions(+) argv++; 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--;