stop DNS lookup immediately instead of async to avoid use-after free if we get BOTH...
authorChristian Grothoff <christian@grothoff.org>
Wed, 23 May 2018 21:37:00 +0000 (23:37 +0200)
committerChristian Grothoff <christian@grothoff.org>
Wed, 23 May 2018 21:37:00 +0000 (23:37 +0200)
src/gns/gnunet-service-gns_resolver.c

index d3c07e9977695d29d97cf23f5abff173bd5e2da7..8b20f2ae36e3a66bf9b25fe88adca84d379cc0f6 100644 (file)
@@ -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)