[dpdk-dev] [PATCH v2] metrics: fix potential missing NULL termination
Thomas Monjalon
thomas at monjalon.net
Wed Apr 4 16:09:53 CEST 2018
22/03/2018 11:33, Ferruh Yigit:
> On 2/20/2018 4:05 PM, Remy Horton wrote:
> > Fixes a potential memory overrun detected by Coverity.
> > This overrun cannot currently happen in practice because
> > rte_metrics_reg_names() explicitly forces the last name
> > character to be a NULL terminator. This patch adds the
> > same enforcement to rte_metrics_get_names() in order to
> > correct the warning, as well as using snprintf instead
> > of strncpy to copy name strings.
>
> There is a patch from Bruce to convert snprintf to strlcpy [1], this patch can
> be part of that one.
>
> [1]
> https://dpdk.org/dev/patchwork/patch/35976/
>
> >
> > Coverity issue: 143434
> > Fixes: 349950ddb9c5 ("metrics: add information metrics library")
> > Fixes: 710cab6f675a ("metrics: fix out of bound access")
> >
> > Signed-off-by: Remy Horton <remy.horton at intel.com>
Updated to use strlcpy and applied.
More information about the dev
mailing list