diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-16 19:29:35 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-16 19:29:35 +0000 |
commit | 261df49654bbd239d9d164177e1d362ed09f8411 (patch) | |
tree | f53c7d737ba10ef361c8a600fd513593617cc938 /src | |
parent | d685060e289634955a81d80874a37d4cb0a58c24 (diff) | |
download | gnunet-261df49654bbd239d9d164177e1d362ed09f8411.tar.gz gnunet-261df49654bbd239d9d164177e1d362ed09f8411.zip |
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/dht_api.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 9c378dca1..1b0840110 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -320,6 +320,9 @@ do_disconnect (struct GNUNET_DHT_Handle *handle) | |||
320 | if (handle->client == NULL) | 320 | if (handle->client == NULL) |
321 | return; | 321 | return; |
322 | GNUNET_assert (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK); | 322 | GNUNET_assert (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK); |
323 | if (NULL != handle->th) | ||
324 | GNUNET_CLIENT_notify_transmit_ready_cancel(handle->th); | ||
325 | handle->th = NULL; | ||
323 | GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO); | 326 | GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO); |
324 | handle->client = NULL; | 327 | handle->client = NULL; |
325 | handle->reconnect_task = | 328 | handle->reconnect_task = |