diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-01-21 18:33:14 +0100 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-08-18 19:47:21 +0000 |
commit | 6ed81620909387c7a55dbe03b152a75fdc219a64 (patch) | |
tree | 6d184a34be80d664fe77da207edd2ca5c3b67f8e | |
parent | 7f0abd5bd5a202f7511463042819d6559659db79 (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>
(cherry picked from commit ff13e46215ab96df988310b4a20eddefad92de99)
-rw-r--r-- | src/vlibapi/api_shared.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c index ce7c4aec712..6849ab0783c 100644 --- a/src/vlibapi/api_shared.c +++ b/src/vlibapi/api_shared.c @@ -595,7 +595,7 @@ vl_msg_api_handler_with_vm_node (api_main_t * am, * 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)) |