From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9856C1B3A8; Wed, 6 Feb 2019 11:44:22 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2019 02:44:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,339,1544515200"; d="scan'208";a="316753187" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga006.fm.intel.com with ESMTP; 06 Feb 2019 02:44:19 -0800 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id x16AiJse006356; Wed, 6 Feb 2019 10:44:19 GMT Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id x16AhiNw000556; Wed, 6 Feb 2019 10:43:44 GMT Received: (from ppoornix@localhost) by wgcvswdev001.ir.intel.com with œ id x16AhilA000552; Wed, 6 Feb 2019 10:43:44 GMT From: Pallantla Poornima To: dev@dpdk.org Cc: reshma.pattan@intel.com, nikhil.rao@intel.com, Pallantla Poornima , stable@dpdk.org Date: Wed, 6 Feb 2019 10:43:42 +0000 Message-Id: <1549449822-412-1-git-send-email-pallantlax.poornima@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-stable] [PATCH] test/eventdev: fix sprintf with snprintf X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2019 10:44:23 -0000 sprintf function is not secure as it doesn't check the length of string. More secure function snprintf is used. Fixes: 2a9c83ae3b ("test/eventdev: add multi-ports test") Cc: stable@dpdk.org Signed-off-by: Pallantla Poornima --- test/test/test_event_eth_rx_adapter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c index 1d3be82b5..38f5c039f 100644 --- a/test/test/test_event_eth_rx_adapter.c +++ b/test/test/test_event_eth_rx_adapter.c @@ -479,7 +479,8 @@ adapter_multi_eth_add_del(void) /* add the max port for rx_adapter */ port_index = rte_eth_dev_count_total(); for (; port_index < RTE_MAX_ETHPORTS; port_index += 1) { - sprintf(driver_name, "%s%u", "net_null", drv_id); + snprintf(driver_name, sizeof(driver_name), "%s%u", "net_null", + drv_id); err = rte_vdev_init(driver_name, NULL); TEST_ASSERT(err == 0, "Failed driver %s got %d", driver_name, err); -- 2.17.2