[dpdk-dev] [PATCH] net/ark: fix for Coverity issues

Ferruh Yigit ferruh.yigit at intel.com
Fri May 12 13:11:13 CEST 2017


On 5/11/2017 12:02 PM, John Miller wrote:
> Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
> Coverity issue: 144513
> 
> Fixes: 727b3fe292bc ("net/ark: integrate PMD")
> Coverity issue: 144514
> 
> Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
> Coverity issue: 144512
> 
> Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")
> Coverity issue: 144517

The convention is Coverity line first, Fixes line later.

> 
> Fixes: 727b3fe292bc ("net/ark: integrate PMD")
> Coverity issue: 144520

Hi John,

Thanks for fixing coverity issues.

Can you please split patch into a patchset with multiple patches,
grouped to same kind of fixes?

And instead of having "coverity fix" in patch title, can you please
describe what is really fixed, like "fix not null terminated buffer" or
"fix missing function return check" etc ...

Thanks,
ferruh

> Signed-off-by: John Miller <john.miller at atomicrules.com>

<...>

> --- a/drivers/net/ark/ark_pktgen.c
> +++ b/drivers/net/ark/ark_pktgen.c
> @@ -354,7 +354,8 @@ struct OPTIONS {
>  			o->v.INT = atoll(val);
>  			break;
>  		case OTSTRING:
> -			strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
> +			strncpy(o->v.STR, val, ARK_MAX_STR_LEN - 1);
> +			o->v.STR[ARK_MAX_STR_LEN - 1] = 0;

This also works, but you can prefer to switch snprintf(), which
guaranties the null termination.

>  			break;
>  		}
>  		return 1;
> 



More information about the dev mailing list