Re: [dpdk-dev] [PATCH v1] metrics: fix potential missing NULL termination

2018-02-20 Thread Remy Horton
On 20/02/2018 15:11, Bruce Richardson wrote: [..] Again, I think the better fix is to replace strncpy with snprintf which will guarantee the null termination, unlike strncpy which is nasty that way. OK, v2 on way..

Re: [dpdk-dev] [PATCH v1] metrics: fix potential missing NULL termination

2018-02-20 Thread Bruce Richardson
On Tue, Feb 20, 2018 at 02:50:01PM +, 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

[dpdk-dev] [PATCH v1] metrics: fix potential missing NULL termination

2018-02-20 Thread Remy Horton
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.