[dpdk-dev] [PATCH] app/testpmd: guarantee that array access is in range

Iremonger, Bernard bernard.iremonger at intel.com
Wed Feb 19 15:02:14 CET 2020



> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit at intel.com>
> Sent: Wednesday, February 19, 2020 12:40 PM
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Wu, Jingjing
> <jingjing.wu at intel.com>; Iremonger, Bernard
> <bernard.iremonger at intel.com>; Lipiec, Herakliusz
> <herakliusz.lipiec at intel.com>; Govindharajan, Hariprasad
> <hariprasad.govindharajan at intel.com>; Burakov, Anatoly
> <anatoly.burakov at intel.com>
> Cc: dev at dpdk.org; Yigit, Ferruh <ferruh.yigit at intel.com>
> Subject: [PATCH] app/testpmd: guarantee that array access is in range
> 
> Coverity complains about out of bound access, which is a false positive.
> 
> The return value of the 'parse_port_list()' can't be bigger than 'maxsize'
> because of the logic in the function. ('value >= (int)maxsize'
> check and 'marked[]' usage.)
> 
> But this is not explicitly clear, causing coverity warning and same question can
> be rise by reviews later.
> 
> Adding a redundant check to highlight the access is in range, this is done by
> replacing existing redundant check.
> 
> This is also good to protect against out out bound access in case
> 'parse_port_list()' behaviour changes later unexpectedly.
> 
> Coverity issue: 354229
> Fixes: 2df00d562d20 ("app/testpmd: add --portlist option")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>

Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>


More information about the dev mailing list