Fix SEGV in generic event sub reaper 58/13058/2
authorMatthew Smith <mgsmith@netgate.com>
Thu, 14 Jun 2018 16:40:49 +0000 (11:40 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Thu, 14 Jun 2018 18:56:16 +0000 (18:56 +0000)
When a client subscribed to receive events disconnects
from the API, while deleting their subscription, a hash
lookup was being performed against a pointer that did
not refer to a hash, resulting in a SEGV.

Perform the hash lookup against the correct hash.

Change-Id: I011d7479e2c3b9ee50721cf7499385c3ff7f704a
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
src/vlibapi/api_helper_macros.h

index fe9cde0..1245db8 100644 (file)
@@ -215,7 +215,7 @@ static clib_error_t * vl_api_want_##lca##_t_reaper (u32 client_index)   \
     vpe_client_registration_t *rp;                                      \
     uword *p;                                                           \
                                                                         \
-    p = hash_get (vam->lca##_registrations, client_index);              \
+    p = hash_get (vam->lca##_registration_hash, client_index);          \
     if (p)                                                              \
       {                                                                 \
         rp = pool_elt_at_index (vam->lca##_registrations, p[0]);        \