Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
5f694d1
)
prom: fix coverity 277312, 277317
28/37128/1
author
Andrew Yourtchenko
<ayourtch@gmail.com>
Thu, 15 Sep 2022 11:46:30 +0000
(11:46 +0000)
committer
Andrew Yourtchenko
<ayourtch@gmail.com>
Thu, 15 Sep 2022 11:46:30 +0000
(11:46 +0000)
If one attempts to add a pattern with zero length, first time
it will succeed, and the second time it will cause an invalid memcmp call.
Solution: do not allow to add zero-length patterns.
Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ic08e021486153be605a4b12a2fe4422307bf68d2
src/plugins/prom/prom.c
patch
|
blob
|
history
diff --git
a/src/plugins/prom/prom.c
b/src/plugins/prom/prom.c
index
6db5020
..
3e0fa3b
100644
(file)
--- a/
src/plugins/prom/prom.c
+++ b/
src/plugins/prom/prom.c
@@
-305,6
+305,8
@@
prom_stat_patterns_add (u8 **patterns)
{
found = 0;
len = vec_len (*pattern);
+ if (len == 0)
+ continue;
vec_foreach (existing, pm->stats_patterns)
{
if (vec_len (*existing) != len)