[dpdk-dev] [PATCH 2/2] examples/vhost_scsi: fix potential buffer overrun with safe copy API

Thomas Monjalon thomas at monjalon.net
Tue May 22 20:18:03 CEST 2018


22/05/2018 19:58, Liu, Changpeng:
> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> > 18/05/2018 01:32, Changpeng Liu:
> > > -			strlcpy((char *)vpage->params, bdev->name,
> > > -					sizeof(vpage->params));
> > > +			vhost_strcpy_pad((char *)vpage->params, bdev->name,
> > > +					sizeof(vpage->params), ' ');
> > 
> > Why do you think vhost_strcpy_pad is safer than strlcpy?
> 
> A code Coverity issue 279452 reported for strlcpy, so here replace with internal API can avoid it.

I think it is a false positive.
Remember that Coverity is just a tool.





More information about the dev mailing list