net/i40e/base: fix potential out of bound array access
authorJingjing Wu <jingjing.wu@intel.com>
Wed, 22 Mar 2017 09:24:55 +0000 (17:24 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 16:59:46 +0000 (18:59 +0200)
commit998c56772d0dc554c0209880d9394a0d14a18c74
treed9be4f8428ce66c459f5eef7dc493ae2ead3bb07
parentd1b4c30b2422ac497eb89ccad39c18fd8ac4b96f
net/i40e/base: fix potential out of bound array access

This is fix for klocwork issue where dcbcfg->numapps could
be greater than size of array (i.e dcbcfg->app[I40E_DCBX_MAX_APPS]).
The fix makes sure the array is not accessed past size of array
(i.e. I40E_DCBX_MAX_APPS).

Fixes: 166dceeeeafc ("i40e/base: add parsing for CEE DCBX TLVs")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/net/i40e/base/i40e_dcb.c