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:
8453fb7
)
bier: fix vector size confusing ASan
88/28388/1
author
Benoît Ganne
<
[email protected]
>
Thu, 16 Apr 2020 10:40:54 +0000
(12:40 +0200)
committer
Andrew Yourtchenko
<
[email protected]
>
Thu, 13 Aug 2020 17:20:47 +0000
(17:20 +0000)
The vector is initialized to 1024 entries which is guaranteed to be
enough, but as its size can shrink between calls, make sure ASan is
aware of the expected size before using it.
Type: fix
Change-Id: I4bcc39867a886b3cb463854d2cda0b32155650e9
Signed-off-by: Benoît Ganne <
[email protected]
>
(cherry picked from commit
77100efb37f7cb333f9ab55dc206bf1431e3ae50
)
src/vnet/bier/bier_lookup.c
patch
|
blob
|
history
diff --git
a/src/vnet/bier/bier_lookup.c
b/src/vnet/bier/bier_lookup.c
index
9361845
..
f7a21a1
100644
(file)
--- a/
src/vnet/bier/bier_lookup.c
+++ b/
src/vnet/bier/bier_lookup.c
@@
-219,15
+219,16
@@
bier_lookup (vlib_main_t * vm,
if (PREDICT_TRUE(0 != n_clones))
{
+ vec_set_len(blm->blm_clones[thread_index], n_clones);
num_cloned = vlib_buffer_clone(vm, bi0,
blm->blm_clones[thread_index],
n_clones,
VLIB_BUFFER_CLONE_HEAD_SIZE);
- vec_set_len(blm->blm_clones[thread_index], num_cloned);
if (num_cloned != n_clones)
{
+ vec_set_len(blm->blm_clones[thread_index], num_cloned);
vlib_node_increment_counter
(vm, node->node_index,
BIER_LOOKUP_ERROR_BUFFER_ALLOCATION_FAILURE, 1);