From patchwork Wed Feb 6 10:39:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poornima, PallantlaX" X-Patchwork-Id: 50140 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E9DF1B39E; Wed, 6 Feb 2019 11:39:51 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 27A075B2A; Wed, 6 Feb 2019 11:39:48 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2019 02:39:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,339,1544515200"; d="scan'208";a="136301406" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 06 Feb 2019 02:39:46 -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 x16AdkuC005126; Wed, 6 Feb 2019 10:39:46 GMT Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id x16AdAAH032499; Wed, 6 Feb 2019 10:39:10 GMT Received: (from ppoornix@localhost) by wgcvswdev001.ir.intel.com with ? id x16AdAS3032495; Wed, 6 Feb 2019 10:39:10 GMT From: Pallantla Poornima To: dev@dpdk.org Cc: reshma.pattan@intel.com, david.hunt@intel.com, Pallantla Poornima , stable@dpdk.org Date: Wed, 6 Feb 2019 10:39:07 +0000 Message-Id: <1549449547-32343-1-git-send-email-pallantlax.poornima@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: Subject: [dpdk-dev] [PATCH] test/distributor: fix sprintf with snprintf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" sprintf function is not secure as it doesn't check the length of string. More secure function snprintf is used. Fixes: f74df2c57e ("test/distributor: test single and burst API") Cc: stable@dpdk.org Signed-off-by: Pallantla Poornima --- test/test/test_distributor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test/test_distributor.c b/test/test/test_distributor.c index 98919ec0c..03df32b05 100644 --- a/test/test/test_distributor.c +++ b/test/test/test_distributor.c @@ -642,9 +642,11 @@ test_distributor(void) worker_params.dist = dist[i]; if (i) - sprintf(worker_params.name, "burst"); + snprintf(worker_params.name, + sizeof(worker_params.name), "burst"); else - sprintf(worker_params.name, "single"); + snprintf(worker_params.name, + sizeof(worker_params.name), "single"); rte_eal_mp_remote_launch(handle_work, &worker_params, SKIP_MASTER);