From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Green Subject: [PATCH v5 09/16] net/qede: strncpy length constant and NUL Date: Sat, 12 May 2018 09:48:29 +0800 Message-ID: <152608970950.121204.17464655040375474076.stgit@localhost.localdomain> References: <152608956198.121204.14844325841690943774.stgit@localhost.localdomain> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: dev@dpdk.org Return-path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 5E5F71CC3A for ; Sat, 12 May 2018 03:48:33 +0200 (CEST) In-Reply-To: <152608956198.121204.14844325841690943774.stgit@localhost.localdomain> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Andy Green Fixes: 8427c6647964 ("net/qede/base: add attention formatting string") Cc: stable@dpdk.org --- drivers/net/qede/base/ecore_int.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c index f43781ba4..d9e22b5ed 100644 --- a/drivers/net/qede/base/ecore_int.c +++ b/drivers/net/qede/base/ecore_int.c @@ -6,6 +6,8 @@ * See LICENSE.qede_pmd for copyright and licensing details. */ +#include + #include "bcm_osal.h" #include "ecore.h" #include "ecore_spq.h" @@ -1104,9 +1106,9 @@ static enum _ecore_status_t ecore_int_deassertion(struct ecore_hwfn *p_hwfn, p_aeu->bit_name, num); else - OSAL_STRNCPY(bit_name, - p_aeu->bit_name, - 30); + strlcpy(bit_name, + p_aeu->bit_name, + sizeof(bit_name)); /* We now need to pass bitmask in its * correct position.