From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C4EB3A00C2; Wed, 4 Jan 2023 04:38:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C65742D32; Wed, 4 Jan 2023 04:38:24 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 0442A410EA for ; Wed, 4 Jan 2023 04:38:22 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id o21so4780736pjw.0 for ; Tue, 03 Jan 2023 19:38:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2ldaOeC6sAyv4sOS0/JMccvt50uRAv0WgV1mhT7P7zc=; b=eL07ir7QXLpU+D5VgZqeasPHrleNIDtrCWlArNcNZkYWWSGEo/279o4Gfo5pPL2skY 5MyJ5zF1GK9DX9QUl1FyMEAVYuJbez49VPGnj83ZQLp1VQz1GStXzKukFrOk8WYEWJnQ GDR6tmtBt5YsQnvNN789d4llrVeQIK00b6vtsWSAsDo8fqzLKmHBdLyyG6ig2K97JQ3w S/STyZJ48sgJCziY8FMOm3z2kdNqGJXG4txL08LcCS+CMftTHs4Voi4gNiFtUPaQBNUi fEoYYVZ1EVEqu0607ZfWEoRP0p4UrEC3UPddqpNPBi6XMElZlv/uwcYcWIfwMx6nR7eo ieeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2ldaOeC6sAyv4sOS0/JMccvt50uRAv0WgV1mhT7P7zc=; b=jPx33zq/X/4ltbw/p4/fdtFK0h8liwLa8adqI2LLI1uIRbHZYW7FP/Jb9+3umwghMr 12M6KdHCuGtZM6BLQxGjVrXrmZR/CAMsP0vflp4JEyKO2cdVS+4b+PJjSHceHIo5J2Qv 65LvQIZSXlvjNQ/K+KhxWl9SttFVfsDRxwHo4q8dEvus8/HlStsNH51DBX1pQPdHIOpO 3pEccvbqapa4YDWj/LQ87LKI4tA2NeM0wz6ZA7jgmJ3EeYYOZqdtOyd9568GSeQ/Chgl Rq/RYi35SYSEwcf6wQF5c22n7XCreI6F55YITPoYvHisZmalmMGdTfOIVVt6XhIxSs2P GtNw== X-Gm-Message-State: AFqh2kpNMdokG4XTgmqvaCw6ocnAMrd9M/6/oJMA3tlLyKpmkBRnfDWG f3OE5/T9atX5EISWKu86i5hIAA== X-Google-Smtp-Source: AMrXdXthL9EIYhxk1UN8UoQfquv3wwpgl0G1f+1YqW2hoDgOncCuBTs43hY0F+9Cj5Kdozj4JfnBzA== X-Received: by 2002:a17:902:ea81:b0:192:6b94:7a89 with SMTP id x1-20020a170902ea8100b001926b947a89mr35782607plb.43.1672803501257; Tue, 03 Jan 2023 19:38:21 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id c10-20020a170903234a00b0017f73caf588sm23091347plh.218.2023.01.03.19.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 19:38:20 -0800 (PST) From: Stephen Hemminger To: Ben Magistro Cc: dev@dpdk.org, Stephen Hemminger Subject: [PATCH v2 3/6] app/dumpcap: check for invalid interface name Date: Tue, 3 Jan 2023 19:38:12 -0800 Message-Id: <20230104033815.35496-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230104033815.35496-1-stephen@networkplumber.org> References: <20230102162441.6205-1-koncept1@gmail.com> <20230104033815.35496-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Avoid any possible issue with ridiculously long name. Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 1c47ff851252..a7aec021204a 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -196,6 +196,9 @@ static void add_interface(uint16_t port, const char *name) { struct interface *intf; + if (strlen(name) >= RTE_ETH_NAME_MAX_LEN) + rte_exit(EXIT_FAILURE, "invalid name for interface: '%s'\n", name); + intf = malloc(sizeof(*intf)); if (!intf) rte_exit(EXIT_FAILURE, "no memory for interface\n"); -- 2.39.0