gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16909 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r16909 - gnunet/src/dht
Date: Fri, 16 Sep 2011 21:29:35 +0200

Author: bartpolot
Date: 2011-09-16 21:29:35 +0200 (Fri, 16 Sep 2011)
New Revision: 16909

Modified:
   gnunet/src/dht/dht_api.c
Log:
Fixed a use after free that occured when doing DHT_Disconnect while the client 
was trying to reconnect to the service.

==12088== Invalid read of size 8
==12088==    at 0x5245EB4: GNUNET_CLIENT_notify_transmit_ready_cancel 
(client.c:1118)
==12088==    by 0x5033F10: GNUNET_DHT_disconnect (dht_api.c:571)
==12088==    by 0x403211: shutdown_task (gnunet-service-mesh.c:3366)
==12088==    by 0x5260292: GNUNET_SCHEDULER_run (scheduler.c:682)
==12088==    by 0x526634B: GNUNET_SERVICE_run (service.c:1590)
==12088==    by 0x401885: main (gnunet-service-mesh.c:3460)
==12088==  Address 0x651fb90 is 32 bytes inside a block of size 64 free'd
==12088==    at 0x4C2556E: free (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12088==    by 0x5245F85: GNUNET_CLIENT_disconnect (client.c:422)
==12088==    by 0x503360A: do_disconnect (dht_api.c:323)
==12088==    by 0x5260292: GNUNET_SCHEDULER_run (scheduler.c:682)
==12088==    by 0x526634B: GNUNET_SERVICE_run (service.c:1590)
==12088==    by 0x401885: main (gnunet-service-mesh.c:3460)



Modified: gnunet/src/dht/dht_api.c
===================================================================
--- gnunet/src/dht/dht_api.c    2011-09-16 18:29:11 UTC (rev 16908)
+++ gnunet/src/dht/dht_api.c    2011-09-16 19:29:35 UTC (rev 16909)
@@ -320,6 +320,9 @@
   if (handle->client == NULL)
     return;
   GNUNET_assert (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+  if (NULL != handle->th)
+      GNUNET_CLIENT_notify_transmit_ready_cancel(handle->th);
+  handle->th = NULL;
   GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
   handle->client = NULL;
   handle->reconnect_task =




reply via email to

[Prev in Thread] Current Thread [Next in Thread]