[dpdk-dev] [PATCH] lib/librte_pipeline:fix the array index out of bound
Rongqiang XIE
xie.rongqiang at zte.com.cn
Wed Aug 23 09:05:32 CEST 2017
In function rte_pipeline_compute_masks(), the value pos equal
p->entries[i]->action,type constraint p->entries[i]->action is
[0,4],but array action_mask1 size is 4,it possible attempt to
access element 4 of array action_mask1.And also in function
rte_pipeline_run(),it possible attempt to access element 4 of
array action_mask0.
Signed-off-by: Rongqiang XIE <xie.rongqiang at zte.com.cn>
---
lib/librte_pipeline/rte_pipeline.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_pipeline/rte_pipeline.c b/lib/librte_pipeline/rte_pipeline.c
index 7f8fbac..2914445 100644
--- a/lib/librte_pipeline/rte_pipeline.c
+++ b/lib/librte_pipeline/rte_pipeline.c
@@ -155,8 +155,8 @@ struct rte_pipeline {
/* Pipeline run structures */
struct rte_mbuf *pkts[RTE_PORT_IN_BURST_SIZE_MAX];
struct rte_pipeline_table_entry *entries[RTE_PORT_IN_BURST_SIZE_MAX];
- uint64_t action_mask0[RTE_PIPELINE_ACTIONS];
- uint64_t action_mask1[RTE_PIPELINE_ACTIONS];
+ uint64_t action_mask0[RTE_PIPELINE_ACTIONS + 1];
+ uint64_t action_mask1[RTE_PIPELINE_ACTIONS + 1];
uint64_t pkts_mask;
uint64_t n_pkts_ah_drop;
uint64_t pkts_drop_mask;
--
1.8.3.1
More information about the dev
mailing list