i40e: fix out of bound read
authorJingjing Wu <jingjing.wu@intel.com>
Thu, 12 Feb 2015 11:22:23 +0000 (19:22 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 1 Apr 2015 19:45:10 +0000 (21:45 +0200)
commitb9a8b2f80959ac6c415b202d9cb39fa529b167f5
tree26edaa6a165ac5ddf94784fddc81bc3ed5b283bb
parentbe2d7a05eb3f2f12eb16f3b43b0b8fa4f62fe655
i40e: fix out of bound read

Klocwork reports array 'src_offset' may use index 16.
In function i40e_srcoff_to_flx_pit, index j + 1 can reach I40E_FDIR_MAX_FLEX_LEN.
This patch fixes this issue to avoid array bound.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/016030.html

Fixes: d8b90c4eabe9 ("i40e: take flow director flexible payload configuration")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
lib/librte_pmd_i40e/i40e_fdir.c