diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-11-30 00:44:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-11-30 00:44:56 +0000 |
commit | 991f51dc78d1690bdf169bca8028a3d0c5fbb177 (patch) | |
tree | d598342dc1458e3a6cbe1eb99dd07745689c16c8 /src/set/gnunet-service-set_intersection.c | |
parent | 7dc458f1c96853831b607c61572270d62efd86d2 (diff) | |
download | gnunet-991f51dc78d1690bdf169bca8028a3d0c5fbb177.tar.gz gnunet-991f51dc78d1690bdf169bca8028a3d0c5fbb177.zip |
-avoid use after free during set intersection completion
Diffstat (limited to 'src/set/gnunet-service-set_intersection.c')
-rw-r--r-- | src/set/gnunet-service-set_intersection.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c index ed29033b4..ceb6a3ccb 100644 --- a/src/set/gnunet-service-set_intersection.c +++ b/src/set/gnunet-service-set_intersection.c | |||
@@ -549,13 +549,15 @@ send_remaining_elements (void *cls) | |||
549 | { | 549 | { |
550 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 550 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
551 | "Sending done and destroy because iterator ran out\n"); | 551 | "Sending done and destroy because iterator ran out\n"); |
552 | op->keep = GNUNET_NO; | ||
552 | send_client_done_and_destroy (op); | 553 | send_client_done_and_destroy (op); |
553 | return; | 554 | return; |
554 | } | 555 | } |
555 | ee = nxt; | 556 | ee = nxt; |
556 | element = &ee->element; | 557 | element = &ee->element; |
557 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 558 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
558 | "Sending element (size %u) to client (full set)\n", | 559 | "Sending element %s:%u to client (full set)\n", |
560 | GNUNET_h2s (&ee->element_hash), | ||
559 | element->size); | 561 | element->size); |
560 | GNUNET_assert (0 != op->spec->client_request_id); | 562 | GNUNET_assert (0 != op->spec->client_request_id); |
561 | ev = GNUNET_MQ_msg_extra (rm, | 563 | ev = GNUNET_MQ_msg_extra (rm, |
@@ -901,9 +903,11 @@ finish_and_destroy (struct Operation *op) | |||
901 | if (GNUNET_SET_RESULT_FULL == op->spec->result_mode) | 903 | if (GNUNET_SET_RESULT_FULL == op->spec->result_mode) |
902 | { | 904 | { |
903 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 905 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
904 | "Sending full result set\n"); | 906 | "Sending full result set (%u elements)\n", |
907 | GNUNET_CONTAINER_multihashmap_size (op->state->my_elements)); | ||
905 | op->state->full_result_iter | 908 | op->state->full_result_iter |
906 | = GNUNET_CONTAINER_multihashmap_iterator_create (op->state->my_elements); | 909 | = GNUNET_CONTAINER_multihashmap_iterator_create (op->state->my_elements); |
910 | op->keep = GNUNET_YES; | ||
907 | send_remaining_elements (op); | 911 | send_remaining_elements (op); |
908 | return; | 912 | return; |
909 | } | 913 | } |
@@ -993,7 +997,8 @@ handle_p2p_done (void *cls, | |||
993 | return; | 997 | return; |
994 | } | 998 | } |
995 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 999 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
996 | "Got final DONE\n"); | 1000 | "Got IntersectionDoneMessage, have %u elements in intersection\n", |
1001 | op->state->my_element_count); | ||
997 | op->state->phase = PHASE_FINISHED; | 1002 | op->state->phase = PHASE_FINISHED; |
998 | finish_and_destroy (op); | 1003 | finish_and_destroy (op); |
999 | } | 1004 | } |