Skip to contentSkip to conversation

test/reorder: fix out of bound access

PATCH Applied Ferruh Yigit 2 participants 2 messages Nov 13, 2018 – Nov 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/reorder: fix out of bound access

The value of array index 'i' is out of bound because of the previous loop it has been used.

Assuming intention is using '0' since the check before free is robufs[0] check, fixing according.

Fixes ecd867faa860 ("test/reorder: fix freeing mbuf twice")
---
 test/test/test_reorder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
test/test/test_reorder.c +1 -1
index ccee4d086..58fa9c71b 100644
@@ -269,7 +269,7 @@ test_reorder_drain(void)
 		goto exit;
 	}
 	if (robufs[0] != NULL)
-		rte_pktmbuf_free(robufs[i]);
+		rte_pktmbuf_free(robufs[0]);
 
 	/* Insert more packets
 	 * RB[] = {NULL, NULL, NULL, NULL}
Signature · 1 line
2.17.2
#1 lore raw

14/11/2018 00:31, Ferruh Yigit:

Quoted 10 lines

The value of array index 'i' is out of bound because of the previous loop it has been used.

Assuming intention is using '0' since the check before free is robufs[0] check, fixing according.

Fixes ecd867faa860 ("test/reorder: fix freeing mbuf twice")

Applied, thanks