aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-08-16 15:45:34 -0700
committerDave Barach <openvpp@barachs.net>2018-08-17 14:47:24 +0000
commitec54e11a8426f4104261da579b5b9ae6fbc506f4 (patch)
treea26a22b528e5519a360da75ed9903fe14f7c1379 /src
parent60f1fc1c17f4e15b8a64ad0b0626e88603790eb7 (diff)
vlibapi: validate private segment rotor prior to use
If the dead client scan removes the rotor position we're about to check next, we end up outside the private registration pool's bounds. Change-Id: If4e715593deeac4c06ae6b3fededc1965b042094 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vlibmemory/vlib_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlibmemory/vlib_api.c b/src/vlibmemory/vlib_api.c
index 35a8686a04d..65fa34bcc63 100644
--- a/src/vlibmemory/vlib_api.c
+++ b/src/vlibmemory/vlib_api.c
@@ -387,9 +387,9 @@ vl_api_clnt_process (vlib_main_t * vm, vlib_node_runtime_t * node,
*/
if (PREDICT_FALSE (vec_len (am->vlib_private_rps)))
{
- vl_mem_api_handle_msg_private (vm, node, private_segment_rotor++);
if (private_segment_rotor >= vec_len (am->vlib_private_rps))
private_segment_rotor = 0;
+ vl_mem_api_handle_msg_private (vm, node, private_segment_rotor++);
}
vlib_process_wait_for_event_or_clock (vm, sleep_time);