[dpdk-stable] [PATCH] pipeline: fix instruction label check

Yogesh Jangra yogesh.jangra at intel.com
Thu Oct 21 05:23:32 CEST 2021


The instruction_data array was incorrectly indexed, which resulted in
the array index getting out of bounds and sometimes segfault.

Fixes: a1711f (“pipeline: add SWX Rx and extract instructions“)
Cc: stable at dpdk.org

Signed-off-by: Yogesh Jangra <yogesh.jangra at intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
 lib/pipeline/rte_swx_pipeline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 1cd09a4..0550560 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -5983,7 +5983,7 @@ struct_field_parse(struct rte_swx_pipeline *p,
 			continue;
 
 		for (j = i + 1; j < n_instructions; j++)
-			CHECK(strcmp(label, data[j].label), EINVAL);
+			CHECK(strcmp(label, instruction_data[j].label), EINVAL);
 	}
 
 	/* Get users for each instruction label. */
-- 
1.8.3.1



More information about the stable mailing list