From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chaitanya Babu Talluri Subject: [PATCH v2] app/test: fix possible overflow using strlcat Date: Mon, 18 Mar 2019 12:36:36 +0000 Message-ID: <1552912596-2776-1-git-send-email-tallurix.chaitanya.babu@intel.com> References: <1552569280-27944-1-git-send-email-tallurix.chaitanya.babu@intel.com> 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 To: dev@dpdk.org Return-path: In-Reply-To: <1552569280-27944-1-git-send-email-tallurix.chaitanya.babu@intel.com> 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 --- 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