[PATCH 02/17] common/mlx5: replace strncpy with strlcpy
Bruce Richardson
bruce.richardson at intel.com
Tue Jun 23 18:51:32 CEST 2026
Replace strncpy() with safer strlcpy() which always null-terminates.
Fixes: aec086c9f1c8 ("common/mlx5: share kernel interface name getter")
Cc: stable at dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/common/mlx5/linux/mlx5_common_os.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c
index e3db6c4124..53bcc9b844 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.c
+++ b/drivers/common/mlx5/linux/mlx5_common_os.c
@@ -231,7 +231,7 @@ mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname)
rte_errno = ENOENT;
return -rte_errno;
}
- strncpy(ifname, match, IF_NAMESIZE);
+ strlcpy(ifname, match, IF_NAMESIZE);
return 0;
}
--
2.53.0
More information about the dev
mailing list