aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-23 23:37:00 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-23 23:37:00 +0200
commit25f35d003e2456be74bed0edf35743107c48ce32 (patch)
tree895aa34f382a6e2cb85933b69ea6252e66f401c6
parent4b9c0d3a08c214719aa32d2cbd689c158634f12b (diff)
stop DNS lookup immediately instead of async to avoid use-after free if we get BOTH an IPv4 and IPv6 response
-rw-r--r--src/gns/gnunet-service-gns_resolver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index d3c07e9977..8b20f2ae36 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -971,6 +971,8 @@ dns_result_parser (void *cls,
&handle_dns_result,
rh);
GNUNET_DNSPARSER_free_packet (p);
+ GNUNET_DNSSTUB_resolve_cancel (rh->dns_request);
+ rh->dns_request = NULL;
return;
}
@@ -1110,6 +1112,8 @@ dns_result_parser (void *cls,
rh->proc (rh->proc_cls,
rd_count - skip,
rd);
+ GNUNET_DNSSTUB_resolve_cancel (rh->dns_request);
+ rh->dns_request = NULL;
}
GNUNET_DNSPARSER_free_packet (p);
if (NULL != rh->task_id)