summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_validation.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amat.us>2017-10-08 08:58:01 -0500
committerDavid Barksdale <amatus@amat.us>2017-10-08 09:51:06 -0500
commit6107aebdf21a59834c3fe0eb6d3d664f1827c7bc (patch)
treea9ad6e74bac4b6f2e73a683ce4ec6354e25a46c2 /src/transport/gnunet-service-transport_validation.c
parentc831b76d24e75c692ab6141f327d1a91d391f93b (diff)
Don't start multiple blacklist checks per ve
This fixes a use-after-free I was seeing.
Diffstat (limited to 'src/transport/gnunet-service-transport_validation.c')
-rw-r--r--src/transport/gnunet-service-transport_validation.c21
1 files changed, 11 insertions, 10 deletions
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);
}