From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 75DDD1B127; Thu, 1 Nov 2018 13:20:09 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 05:20:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,451,1534834800"; d="scan'208";a="83244703" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.212]) by fmsmga008.fm.intel.com with ESMTP; 01 Nov 2018 05:20:07 -0700 From: Ferruh Yigit To: Thomas Monjalon , Hemant Agrawal , Shreyansh Jain Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Date: Thu, 1 Nov 2018 13:19:50 +0000 Message-Id: <20181101131951.91459-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 1/2] bus/dpaa: fix build with gcc 9.0 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2018 12:20:10 -0000 build error: In function ‘fman_if_init’, .../drivers/bus/dpaa/base/fman/fman.c:186:2: error: ‘strncpy’ output may be truncated copying 4095 bytes from a string of length 4095 [-Werror=stringop-truncation] strncpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1); strncpy may result a not null-terminated string, replaced it with rte_strscpy Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- drivers/bus/dpaa/base/fman/fman.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c index bdb700423..ddcd7d1f3 100644 --- a/drivers/bus/dpaa/base/fman/fman.c +++ b/drivers/bus/dpaa/base/fman/fman.c @@ -13,6 +13,7 @@ #include #include #include +#include #define QMI_PORT_REGS_OFFSET 0x400 @@ -183,7 +184,7 @@ fman_if_init(const struct device_node *dpa_node) } memset(__if, 0, sizeof(*__if)); INIT_LIST_HEAD(&__if->__if.bpool_list); - strncpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1); + rte_strscpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1); __if->node_path[PATH_MAX - 1] = '\0'; /* Obtain the MAC node used by this interface except macless */ -- 2.17.2