From: David Barksdale Date: Sun, 8 Oct 2017 13:58:01 +0000 (-0500) Subject: Don't start multiple blacklist checks per ve X-Git-Tag: gnunet-0.11.0rc0~102^2~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6107aebdf21a59834c3fe0eb6d3d664f1827c7bc;p=oweals%2Fgnunet.git Don't start multiple blacklist checks per ve This fixes a use-after-free I was seeing. --- diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 4a6d427be..5a8539f72 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c @@ -697,7 +697,6 @@ revalidate_address (void *cls) struct GNUNET_TIME_Relative canonical_delay; struct GNUNET_TIME_Relative delay; struct GNUNET_TIME_Relative blocked_for; - struct GST_BlacklistCheck *bc; uint32_t rdelay; ve->revalidation_task = NULL; @@ -784,15 +783,17 @@ revalidate_address (void *cls) GNUNET_STATISTICS_update (GST_stats, gettext_noop ("# address revalidations started"), 1, GNUNET_NO); - bc = GST_blacklist_test_allowed (&ve->address->peer, - ve->address->transport_name, - &transmit_ping_if_allowed, - ve, - NULL, - NULL); - if (NULL != bc) - ve->bc = bc; /* only set 'bc' if 'transmit_ping_if_allowed' was not already - * called... */ + if (NULL != ve->bc) + { + GST_blacklist_test_cancel (ve->bc); + ve->bc = NULL; + } + ve->bc = GST_blacklist_test_allowed (&ve->address->peer, + ve->address->transport_name, + &transmit_ping_if_allowed, + ve, + NULL, + NULL); }