From 456ded496f93eb8156dc6e7b5a81d4a3aa604f60 Mon Sep 17 00:00:00 2001 From: Eyal Bari Date: Sun, 22 Jul 2018 12:45:15 +0300 Subject: fix vector index range checks (VPP-1353) Change-Id: I63c36644c9d93f2c3ec6606ca0205b407499de4e Signed-off-by: Eyal Bari (cherry picked from commit cd30774fa9280736ffaea3e9a51948593e8eebc2) Signed-off-by: John Lo --- src/svm/svm_fifo_segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/svm') diff --git a/src/svm/svm_fifo_segment.c b/src/svm/svm_fifo_segment.c index 7c6d80229ad..800278229c9 100644 --- a/src/svm/svm_fifo_segment.c +++ b/src/svm/svm_fifo_segment.c @@ -551,7 +551,7 @@ svm_fifo_segment_num_free_fifos (svm_fifo_segment_private_t * fifo_segment, freelist_index = max_log2 (rounded_data_size) - max_log2 (FIFO_SEGMENT_MIN_FIFO_SIZE); - if (freelist_index > vec_len (fsh->free_fifos)) + if (freelist_index >= vec_len (fsh->free_fifos)) return 0; f = fsh->free_fifos[freelist_index]; -- cgit 1.2.3-korg