aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-01-21 18:33:14 +0100
committerDave Barach <openvpp@barachs.net>2020-06-15 19:04:25 +0000
commitff13e46215ab96df988310b4a20eddefad92de99 (patch)
tree29c13c3db019ac9ad2d9041352b453ccccbbe62a /src
parent810ad343de3bc2680f8f8be67027f87da196f5d1 (diff)
api: check id is valid for bounce checking
If the id is invalid we cannot check whether we must free the message or not, free it anyway. Type: fix Change-Id: Ie4426f601390d1e5e14c739f670e8c1e6e3aaf1e Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vlibapi/api_shared.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c
index c818668c09f..caad6e54828 100644
--- a/src/vlibapi/api_shared.c
+++ b/src/vlibapi/api_shared.c
@@ -639,7 +639,7 @@ vl_msg_api_handler_with_vm_node (api_main_t * am, svm_region_t * vlib_rp,
* Special-case, so we can e.g. bounce messages off the vnet
* main thread without copying them...
*/
- if (!(am->message_bounce[id]))
+ if (id >= vec_len (am->message_bounce) || !(am->message_bounce[id]))
vl_msg_api_free (the_msg);
if (PREDICT_FALSE (am->elog_trace_api_messages))