From patchwork Thu Mar 14 13:14:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chaitanya Babu, TalluriX" X-Patchwork-Id: 51185 X-Patchwork-Delegate: gakhil@marvell.com 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 2BE214CA7; Thu, 14 Mar 2019 14:18:04 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B00011E2F; Thu, 14 Mar 2019 14:18:00 +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 fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2019 06:17:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,478,1544515200"; d="scan'208";a="327271407" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga006.fm.intel.com with ESMTP; 14 Mar 2019 06:17:58 -0700 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 x2EDHvr0010709; Thu, 14 Mar 2019 13:17:57 GMT Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id x2EDHI48028470; Thu, 14 Mar 2019 13:17:18 GMT Received: (from tchaitax@localhost) by wgcvswdev001.ir.intel.com with ? id x2EDHIVP028466; Thu, 14 Mar 2019 13:17:18 GMT From: Chaitanya Babu Talluri To: dev@dpdk.org Cc: reshma.pattan@intel.com, jananeex.m.parthasarathy@intel.com, pablo.de.lara.guarch@intel.com, declan.doherty@intel.com, Chaitanya Babu Talluri , stable@dpdk.org Date: Thu, 14 Mar 2019 13:14:40 +0000 Message-Id: <1552569280-27944-1-git-send-email-tallurix.chaitanya.babu@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] app/test: fix possible overflow with strcat 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" strcat does not check the destination length and there might be chances of string overflow so instead of strcat, strlcat is used. Fixes: 6f4eec2565 ("test/crypto: enhance scheduler unit tests") Cc: stable@dpdk.org Signed-off-by: Chaitanya Babu Talluri --- app/test/test_cryptodev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 32f1893bc..2ff204137 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER #include @@ -375,7 +376,7 @@ testsuite_setup(void) snprintf(vdev_args, sizeof(vdev_args), "%s%d", temp_str, i); strcpy(temp_str, vdev_args); - strcat(temp_str, ";"); + strlcat(temp_str, ";", sizeof(temp_str)); slave_core_count++; socket_id = lcore_config[i].socket_id; }