[dpdk-dev] app/testbbdev: fix out-of-bounds read

Message ID 1517406381-130154-1-git-send-email-amr.mokhtar@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Mokhtar, Amr Jan. 31, 2018, 1:46 p.m. UTC
Coverity issue: 257033
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
---
 app/test-bbdev/test_bbdev_vector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Jan. 31, 2018, 3:03 p.m. UTC | #1
31/01/2018 14:46, Amr Mokhtar:
> Coverity issue: 257033
> Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
> 
> Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index 2d0852c..addef05 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -288,7 +288,7 @@  parse_data_entry(const char *key_token, char *token,
 	struct op_data_buf *op_data;
 	unsigned int *nb_ops;
 
-	if (type > DATA_NUM_TYPES) {
+	if (type >= DATA_NUM_TYPES) {
 		printf("Unknown op type: %d!\n", type);
 		return -1;
 	}