From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
stable@dpdk.org, Julien Aube <julien_dpdk@jaube.fr>,
Stephen Hemminger <stephen@networkplumber.org>,
Harish Patil <harish.patil@cavium.com>
Subject: [PATCH v2 07/17] net/bnx2x: replace strncpy with strlcpy
Date: Wed, 24 Jun 2026 11:36:46 +0100 [thread overview]
Message-ID: <20260624103658.792750-8-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260624103658.792750-1-bruce.richardson@intel.com>
Replace strncpy() with safer strlcpy() which always null-terminates.
Fixes: 540a211084a7 ("bnx2x: driver core")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/bnx2x/bnx2x.c | 2 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 8790c858d5..1a3956b224 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -3596,7 +3596,7 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x_softc *sc)
{
struct eth_stats_info *ether_stat = &sc->sp->drv_info_to_mcp.ether_stat;
- strncpy(ether_stat->version, BNX2X_DRIVER_VERSION,
+ strlcpy(ether_stat->version, BNX2X_DRIVER_VERSION,
ETH_STAT_INFO_VERSION_LEN);
sc->sp_objs[0].mac_obj.get_n_elements(sc, &sc->sp_objs[0].mac_obj,
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 5411df3a38..23f576877f 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -303,7 +303,7 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_
PMD_DRV_LOG(DEBUG, sc, "status block count = %d, base status block = %x",
sc->igu_sb_cnt, sc->igu_base_sb);
- strncpy(sc->fw_ver, sc_resp.fw_ver, sizeof(sc->fw_ver));
+ strlcpy(sc->fw_ver, sc_resp.fw_ver, sizeof(sc->fw_ver));
if (rte_is_valid_assigned_ether_addr(&sc_resp.resc.current_mac_addr))
rte_ether_addr_copy(&sc_resp.resc.current_mac_addr,
--
2.53.0
next prev parent reply other threads:[~2026-06-24 10:37 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 16:51 [PATCH 00/17] drivers: replace strncpy with strlcpy Bruce Richardson
2026-06-23 16:51 ` [PATCH 01/17] common/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 02/17] common/mlx5: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 03/17] crypto/mvsam: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 04/17] crypto/scheduler: " Bruce Richardson
2026-06-23 16:59 ` Bruce Richardson
2026-06-23 16:51 ` [PATCH 05/17] event/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 06/17] net/ark: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 07/17] net/bnx2x: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 08/17] net/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 09/17] net/dpaa: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 10/17] net/ionic: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 11/17] net/mlx4: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 12/17] net/mlx5: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 13/17] net/nfp: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 14/17] net/qede: " Bruce Richardson
2026-06-23 17:02 ` Bruce Richardson
2026-06-23 16:51 ` [PATCH 15/17] net/softnic: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 16/17] net/vhost: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 17/17] net/virtio: " Bruce Richardson
2026-06-23 17:33 ` [PATCH 00/17] drivers: " Stephen Hemminger
2026-06-24 7:49 ` Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 01/17] common/cnxk: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 02/17] common/mlx5: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 03/17] crypto/mvsam: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 04/17] crypto/scheduler: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 05/17] event/cnxk: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 06/17] net/ark: " Bruce Richardson
2026-06-24 10:36 ` Bruce Richardson [this message]
2026-06-24 10:36 ` [PATCH v2 08/17] net/cnxk: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 09/17] net/dpaa: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 10/17] net/ionic: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 11/17] net/mlx4: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 12/17] net/mlx5: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 13/17] net/nfp: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 14/17] net/qede: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 15/17] net/softnic: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 16/17] net/vhost: " Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 17/17] net/virtio: " Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624103658.792750-8-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=harish.patil@cavium.com \
--cc=julien_dpdk@jaube.fr \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox