diff mbox series

[iproute2,2/2] tc: ct: Fix invalid pointer derefence

Message ID 20221116073312.177786-3-roid@nvidia.com (mailing list archive)
State New, archived
Delegated to: Stephen Hemminger
Headers show
Series two fixes for tc ct command | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Roi Dayan Nov. 16, 2022, 7:33 a.m. UTC
Using mcaro NEXT_ARG_FWD does not validate argc.
Use macro NEXT_ARG which validates argc while parsing args
in the same loop iteration.

Fixes: c8a494314c40 ("tc: Introduce tc ct action")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
---
 tc/m_ct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tc/m_ct.c b/tc/m_ct.c
index 1b8984075a67..e1c4b822f8ac 100644
--- a/tc/m_ct.c
+++ b/tc/m_ct.c
@@ -243,7 +243,7 @@  parse_ct(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 				return -1;
 			}
 
-			NEXT_ARG_FWD();
+			NEXT_ARG();
 			if (matches(*argv, "port") != 0)
 				continue;