From patchwork Sat Aug 12 12:04:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 800872 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xV0wl61vbz9t3C for ; Sat, 12 Aug 2017 22:07:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124AbdHLMHC (ORCPT ); Sat, 12 Aug 2017 08:07:02 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:58707 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174AbdHLMG5 (ORCPT ); Sat, 12 Aug 2017 08:06:57 -0400 Received: from mail.nwl.cc (orbyte.nwl.cc [127.0.0.1]) by mail.nwl.cc (Postfix) with ESMTP id 6FD31683D9; Sat, 12 Aug 2017 14:06:56 +0200 (CEST) Received: from xsao (localhost [IPv6:::1]) by mail.nwl.cc (Postfix) with ESMTP id 4ADC168252; Sat, 12 Aug 2017 14:06:56 +0200 (CEST) From: Phil Sutter To: Stephen Hemminger Cc: netdev@vger.kernel.org Subject: [iproute PATCH 11/51] iproute: Check mark value input Date: Sat, 12 Aug 2017 14:04:30 +0200 Message-Id: <20170812120510.28750-12-phil@nwl.cc> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170812120510.28750-1-phil@nwl.cc> References: <20170812120510.28750-1-phil@nwl.cc> X-Virus-Scanned: ClamAV using ClamSMTP Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Phil Sutter --- ip/iproute.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ip/iproute.c b/ip/iproute.c index 89caac124f489..5fe8a3a75d5b7 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -1495,7 +1495,8 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action) id = *argv; } else if (strcmp(*argv, "mark") == 0) { NEXT_ARG(); - get_unsigned(&mark, *argv, 0); + if (get_unsigned(&mark, *argv, 0)) + invarg("invalid mark value\n", *argv); filter.markmask = -1; } else if (strcmp(*argv, "via") == 0) { int family; @@ -1712,7 +1713,8 @@ static int iproute_get(int argc, char **argv) idev = *argv; } else if (matches(*argv, "mark") == 0) { NEXT_ARG(); - get_unsigned(&mark, *argv, 0); + if (get_unsigned(&mark, *argv, 0)) + invarg("invalid mark value\n", *argv); } else if (matches(*argv, "oif") == 0 || strcmp(*argv, "dev") == 0) { NEXT_ARG();