patch 'cfgfile: fix section count with no name' has been queued to stable release 23.11.6
Shani Peretz
shperetz at nvidia.com
Sun Dec 21 15:55:57 CET 2025
Hi,
FYI, your patch has been queued to stable release 23.11.6
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/26/25. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/shanipr/dpdk-stable
This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/37cc8cb726f37d9ca35142d10f54f324c9b0e4b2
Thanks.
Shani
---
>From 37cc8cb726f37d9ca35142d10f54f324c9b0e4b2 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Mon, 3 Feb 2025 13:33:19 +0100
Subject: [PATCH] cfgfile: fix section count with no name
[ upstream commit 02bce2f1e938b409bb6f85391510a2a33ecc1443 ]
Passing a NULL to strncmp is incorrect.
+ ------------------------------------------------------- +
+ Test Suite : Test Cfgfile Unit Test Suite
+ ------------------------------------------------------- +
../lib/cfgfile/rte_cfgfile.c:475:7: runtime error: null pointer passed as
argument 2, which is declared to never be null
On the other hand, it seems the intent was to count all sections, so
skip the whole loop and section name comparisons.
Fixes: c54e7234bc9e ("test/cfgfile: add basic unit tests")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
lib/cfgfile/rte_cfgfile.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/cfgfile/rte_cfgfile.c b/lib/cfgfile/rte_cfgfile.c
index 2f9cc0722a..a0c1322f43 100644
--- a/lib/cfgfile/rte_cfgfile.c
+++ b/lib/cfgfile/rte_cfgfile.c
@@ -467,10 +467,14 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg)
int
rte_cfgfile_num_sections(struct rte_cfgfile *cfg, const char *sectionname,
-size_t length)
+ size_t length)
{
- int i;
int num_sections = 0;
+ int i;
+
+ if (sectionname == NULL)
+ return cfg->num_sections;
+
for (i = 0; i < cfg->num_sections; i++) {
if (strncmp(cfg->sections[i].name, sectionname, length) == 0)
num_sections++;
--
2.43.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-12-21 16:54:17.853725306 +0200
+++ 0009-cfgfile-fix-section-count-with-no-name.patch 2025-12-21 16:54:16.655130000 +0200
@@ -1 +1 @@
-From 02bce2f1e938b409bb6f85391510a2a33ecc1443 Mon Sep 17 00:00:00 2001
+From 37cc8cb726f37d9ca35142d10f54f324c9b0e4b2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 02bce2f1e938b409bb6f85391510a2a33ecc1443 ]
+
@@ -28 +30 @@
-index 8bbdcf146e..9723ec756f 100644
+index 2f9cc0722a..a0c1322f43 100644
@@ -31,2 +33,2 @@
-@@ -477,10 +477,14 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg)
- RTE_EXPORT_SYMBOL(rte_cfgfile_num_sections)
+@@ -467,10 +467,14 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg)
+
More information about the stable
mailing list