patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v3 4/6] test: fix format overflow warning in ACL test
       [not found] ` <20251117175332.14014-1-stephen@networkplumber.org>
@ 2025-11-17 17:52   ` Stephen Hemminger
  2025-11-17 17:52   ` [PATCH v3 5/6] test: fix impossible format-truncation in cfgfiles Stephen Hemminger
  1 sibling, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-11-17 17:52 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, stable, cristian.dumitrescu, Pablo de Lara

This test has an array of input lines, but the two dimensional
array confuses compiler length checks. Convert to an array
of pointers to fixed strings which avoids the problem.
Make both variables static since not shared with other code.

Fixes: 5205954791cb ("app/test: packet framework unit tests")
Cc: stable@dpdk.org
Cc: cristian.dumitrescu@intel.com

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_table_acl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c
index dff9bddfb9..94edf37234 100644
--- a/app/test/test_table_acl.c
+++ b/app/test/test_table_acl.c
@@ -317,7 +317,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v)
  * separated by ' : ', just ':'. It's a lot more readable and
  * cleaner, IMO.
  */
-char lines[][128] = {
+static const char * const lines[] = {
 	"@0.0.0.0/0 0.0.0.0/0 0:65535 0:65535 2/0xff", /* Protocol check */
 	"@192.168.3.1/32 0.0.0.0/0 0:65535 0:65535 0/0", /* Src IP checl */
 	"@0.0.0.0/0 10.4.4.1/32 0:65535 0:65535 0/0", /* dst IP check */
@@ -325,7 +325,7 @@ char lines[][128] = {
 	"@0.0.0.0/0 0.0.0.0/0 0:65535 206:206 0/0", /* dst port check */
 };
 
-char line[128];
+static char line[128];
 
 
 static int
-- 
2.51.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v3 5/6] test: fix impossible format-truncation in cfgfiles
       [not found] ` <20251117175332.14014-1-stephen@networkplumber.org>
  2025-11-17 17:52   ` [PATCH v3 4/6] test: fix format overflow warning in ACL test Stephen Hemminger
@ 2025-11-17 17:52   ` Stephen Hemminger
  1 sibling, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-11-17 17:52 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, stable, Cristian Dumitrescu, Bruce Richardson

Although, it is not possible on Linux (which always uses /tmp)
the compiler complains about possible snprintf() truncation.
Simplest fix is to just increase the size of the filename variable.

Fixes: be22019a58c4 ("test: restore cfgfile tests")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_cfgfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_cfgfile.c b/app/test/test_cfgfile.c
index b189d9d7a5..823b48e1fa 100644
--- a/app/test/test_cfgfile.c
+++ b/app/test/test_cfgfile.c
@@ -148,7 +148,7 @@ static int
 test_cfgfile_realloc_sections(void)
 {
 	struct rte_cfgfile *cfgfile;
-	char filename[PATH_MAX];
+	char filename[PATH_MAX + NAME_MAX];
 	int ret;
 	const char *value;
 
-- 
2.51.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-17 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20251115193409.99740-1-stephen@networkplumber.org>
     [not found] ` <20251117175332.14014-1-stephen@networkplumber.org>
2025-11-17 17:52   ` [PATCH v3 4/6] test: fix format overflow warning in ACL test Stephen Hemminger
2025-11-17 17:52   ` [PATCH v3 5/6] test: fix impossible format-truncation in cfgfiles Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).