* [dpdk-dev] [PATCH v1] lib/metrics: disallow NULL as metric name
@ 2018-07-02 13:46 Remy Horton
2018-07-20 15:30 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Remy Horton @ 2018-07-02 13:46 UTC (permalink / raw)
To: dev; +Cc: Reshma Pattan
This patch adds a sanity check so that names passed into
rte_metrics_reg_names() and the wrapper rte_metrics_reg_name()
cannot be NULL.
Fixes: 349950ddb9c5 ("metrics: add information metrics library")
Signed-off-by: Remy Horton <remy.horton@intel.com>
---
lib/librte_metrics/rte_metrics.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/librte_metrics/rte_metrics.c b/lib/librte_metrics/rte_metrics.c
index 258f058..2275244 100644
--- a/lib/librte_metrics/rte_metrics.c
+++ b/lib/librte_metrics/rte_metrics.c
@@ -96,6 +96,9 @@ rte_metrics_reg_names(const char * const *names, uint16_t cnt_names)
/* Some sanity checks */
if (cnt_names < 1 || names == NULL)
return -EINVAL;
+ for (idx_name = 0; idx_name < cnt_names; idx_name++)
+ if (names[idx_name] == NULL)
+ return -EINVAL;
memzone = rte_memzone_lookup(RTE_METRICS_MEMZONE_NAME);
if (memzone == NULL)
--
2.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1] lib/metrics: disallow NULL as metric name
2018-07-02 13:46 [dpdk-dev] [PATCH v1] lib/metrics: disallow NULL as metric name Remy Horton
@ 2018-07-20 15:30 ` Ferruh Yigit
2018-07-26 18:31 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2018-07-20 15:30 UTC (permalink / raw)
To: Remy Horton, dev; +Cc: Reshma Pattan
On 7/2/2018 2:46 PM, Remy Horton wrote:
> This patch adds a sanity check so that names passed into
> rte_metrics_reg_names() and the wrapper rte_metrics_reg_name()
> cannot be NULL.
>
> Fixes: 349950ddb9c5 ("metrics: add information metrics library")
>
> Signed-off-by: Remy Horton <remy.horton@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1] lib/metrics: disallow NULL as metric name
2018-07-20 15:30 ` Ferruh Yigit
@ 2018-07-26 18:31 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-07-26 18:31 UTC (permalink / raw)
To: Remy Horton; +Cc: dev, Ferruh Yigit, Reshma Pattan
20/07/2018 17:30, Ferruh Yigit:
> On 7/2/2018 2:46 PM, Remy Horton wrote:
> > This patch adds a sanity check so that names passed into
> > rte_metrics_reg_names() and the wrapper rte_metrics_reg_name()
> > cannot be NULL.
> >
> > Fixes: 349950ddb9c5 ("metrics: add information metrics library")
> >
> > Signed-off-by: Remy Horton <remy.horton@intel.com>
>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-26 18:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 13:46 [dpdk-dev] [PATCH v1] lib/metrics: disallow NULL as metric name Remy Horton
2018-07-20 15:30 ` Ferruh Yigit
2018-07-26 18:31 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).