On 10/13/2020 2:07 PM, Kevin Laatz wrote:
Add a check for the return value of the sscanf call in
parse_internal_args(), returning an error if we don't get the expected
result.
Coverity issue: 362049
Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
Cc: sta...@dpdk.org
Signed-off-by: Kevin Laatz <kevin.la...@intel.com>
<...>
+#define ETH_RING_INTERNAL_ARG_MAX_LEN 19
Added following comment while merging: /* "0x..16chars..\0" */
<...>
- sscanf(value, "%p", &args);
+ /* make sure 'value' is valid pointer length */
+ if (strnlen(value, ETH_RING_INTERNAL_ARG_MAX_LEN) >=
+ ETH_RING_INTERNAL_ARG_MAX_LEN) {
+ PMD_LOG(ERR, "Error parsing internal args, 'value' too long");
'value' is variable name and may not fit to the debug log.
Replaced with "..., argument is too long" while merging.
Reviewed-by: Ferruh Yigit <ferruh.yi...@intel.com>
Applied to dpdk-next-net/main, thanks.