From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D1472A05FE for ; Mon, 18 Mar 2019 13:38:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3045E4C93; Mon, 18 Mar 2019 13:38:23 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6A0FD2C60; Mon, 18 Mar 2019 13:38:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 05:38:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,493,1544515200"; d="scan'208";a="141657008" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 18 Mar 2019 05:38:17 -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 x2ICcG4R019333; Mon, 18 Mar 2019 12:38:16 GMT Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id x2ICbauF003062; Mon, 18 Mar 2019 12:37:36 GMT Received: (from tchaitax@localhost) by wgcvswdev001.ir.intel.com with œ id x2ICbaH7003056; Mon, 18 Mar 2019 12:37:36 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: Mon, 18 Mar 2019 12:36:36 +0000 Message-Id: <1552912596-2776-1-git-send-email-tallurix.chaitanya.babu@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1552569280-27944-1-git-send-email-tallurix.chaitanya.babu@intel.com> References: <1552569280-27944-1-git-send-email-tallurix.chaitanya.babu@intel.com> Subject: [dpdk-dev] [PATCH v2] app/test: fix possible overflow using strlcat 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190318123636.wRMGNjxpqUf8wdtp9v3dU_8HibSLOVS8APLbVO2Mq4g@z> 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 --- v2: Updated title. --- 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; } -- 2.17.2