From: Bruce Richardson Date: Tue, 16 Dec 2014 16:30:23 +0000 (+0000) Subject: ixgbe: fix array overflow in vector Rx X-Git-Tag: spdx-start~9938 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=199e6b913ed1500476c1ac79d4437a6b6600ea30;p=dpdk.git ixgbe: fix array overflow in vector Rx Switch the order of the conditions in a while loop, so we check the range of "i" against the max, before using it to index into the array. Signed-off-by: Bruce Richardson --- diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c index 3a30fa7ea2..b54cb19129 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c @@ -489,7 +489,7 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, unsigned i = 0; if (rxq->pkt_first_seg == NULL) { /* find the first split flag, and only reassemble then*/ - while (!split_flags[i] && i < nb_bufs) + while (i < nb_bufs && !split_flags[i]) i++; if (i == nb_bufs) return nb_bufs;