aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-06-26 15:04:02 +0000
committerBart Polot <bart@net.in.tum.de>2015-06-26 15:04:02 +0000
commit2527e4072121667966226b9da4f8c481011f3b2f (patch)
tree4ddb5f55f2e41b32e84136a529c90db593af9201
parent93860c5f352bebb5cb9317a2ec92266894eb9a18 (diff)
downloadgnunet-2527e4072121667966226b9da4f8c481011f3b2f.tar.gz
gnunet-2527e4072121667966226b9da4f8c481011f3b2f.zip
- GNUNET_CADET_disconnect will destroy pending channels and call the cleanup callback on them, and cleanup_channel does access peer_map. If peer_map is destroyed before CADET_disconnect, a use-after-free happens.
-rw-r--r--src/rps/gnunet-service-rps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 47627fb51..35d11e90c 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2380,7 +2380,7 @@ peer_remove_cb (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
2380 0); 2380 0);
2381 } 2381 }
2382 2382
2383 /* If we are still waiting for notification whether this peer is live 2383 /* If we are still waiting for notification whether this peer is live
2384 * cancel the according task */ 2384 * cancel the according task */
2385 if (NULL != peer_ctx->is_live_task) 2385 if (NULL != peer_ctx->is_live_task)
2386 { 2386 {
@@ -2498,8 +2498,8 @@ shutdown_task (void *cls,
2498 "Size of the peermap: %u\n", 2498 "Size of the peermap: %u\n",
2499 GNUNET_CONTAINER_multipeermap_size (peer_map)); 2499 GNUNET_CONTAINER_multipeermap_size (peer_map));
2500 GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_size (peer_map)); 2500 GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_size (peer_map));
2501 GNUNET_CONTAINER_multipeermap_destroy (peer_map);
2502 GNUNET_CADET_disconnect (cadet_handle); 2501 GNUNET_CADET_disconnect (cadet_handle);
2502 GNUNET_CONTAINER_multipeermap_destroy (peer_map);
2503 GNUNET_CONTAINER_multipeermap_destroy (view); 2503 GNUNET_CONTAINER_multipeermap_destroy (view);
2504 view = NULL; 2504 view = NULL;
2505 GNUNET_array_grow (push_list, push_list_size, 0); 2505 GNUNET_array_grow (push_list, push_list_size, 0);