diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2014-05-26 09:32:54 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2014-05-26 09:32:54 +0000 |
commit | 661e811fef7d0ef6b62892a87ec3723edb0ca3bc (patch) | |
tree | 205f517bc334ef48e34af8d6131b248080acd214 /src | |
parent | 5383f4e6dc8b43519d3ef5a28606fbca066d597a (diff) | |
download | gnunet-661e811fef7d0ef6b62892a87ec3723edb0ca3bc.tar.gz gnunet-661e811fef7d0ef6b62892a87ec3723edb0ca3bc.zip |
- fixed bug in set which allows a peer to generate a malformed session setup
- fixed double-cancel of a set-handle
Diffstat (limited to 'src')
-rw-r--r-- | src/scalarproduct/gnunet-service-scalarproduct.c | 6 | ||||
-rw-r--r-- | src/set/gnunet-service-set_intersection.c | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct.c b/src/scalarproduct/gnunet-service-scalarproduct.c index 0ce5ffccc..de3849690 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct.c +++ b/src/scalarproduct/gnunet-service-scalarproduct.c | |||
@@ -1279,8 +1279,10 @@ cb_intersection_element_removed (void *cls, | |||
1279 | GNUNET_SET_listen_cancel (s->intersection_listen); | 1279 | GNUNET_SET_listen_cancel (s->intersection_listen); |
1280 | s->intersection_listen = NULL; | 1280 | s->intersection_listen = NULL; |
1281 | } | 1281 | } |
1282 | |||
1282 | // the op failed and has already been invalidated by the set service | 1283 | // the op failed and has already been invalidated by the set service |
1283 | s->intersection_op = NULL; | 1284 | s->intersection_op = NULL; |
1285 | s->intersection_set = NULL; | ||
1284 | break; | 1286 | break; |
1285 | } | 1287 | } |
1286 | 1288 | ||
@@ -1893,7 +1895,7 @@ cb_channel_destruction (void *cls, | |||
1893 | // as we have only one peer connected in each session, just remove the session | 1895 | // as we have only one peer connected in each session, just remove the session |
1894 | s->channel = NULL; | 1896 | s->channel = NULL; |
1895 | 1897 | ||
1896 | if ((ALICE == s->role) && (GNUNET_NO != s->active) && (!do_shutdown)) | 1898 | if ((ALICE == s->role) && (GNUNET_YES == s->active) && (!do_shutdown)) |
1897 | { | 1899 | { |
1898 | // if this happened before we received the answer, we must terminate the session | 1900 | // if this happened before we received the answer, we must terminate the session |
1899 | s->role = GNUNET_SYSERR; | 1901 | s->role = GNUNET_SYSERR; |
@@ -1901,7 +1903,7 @@ cb_channel_destruction (void *cls, | |||
1901 | GNUNET_SCHEDULER_add_now (&prepare_client_end_notification, | 1903 | GNUNET_SCHEDULER_add_now (&prepare_client_end_notification, |
1902 | s); | 1904 | s); |
1903 | } | 1905 | } |
1904 | else | 1906 | else if ((BOB == s->role) && (GNUNET_SYSERR != s->active)) |
1905 | { | 1907 | { |
1906 | if ((s == from_service_head) || ((NULL != from_service_head) && ((NULL != s->next) || (NULL != s->a_tail)))) | 1908 | if ((s == from_service_head) || ((NULL != from_service_head) && ((NULL != s->next) || (NULL != s->a_tail)))) |
1907 | GNUNET_CONTAINER_DLL_remove (from_service_head, from_service_tail, s); | 1909 | GNUNET_CONTAINER_DLL_remove (from_service_head, from_service_tail, s); |
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c index 9b327ec78..4709e3d82 100644 --- a/src/set/gnunet-service-set_intersection.c +++ b/src/set/gnunet-service-set_intersection.c | |||
@@ -748,6 +748,11 @@ handle_p2p_element_info (void *cls, const struct GNUNET_MessageHeader *mh) | |||
748 | GNUNET_break_op (0); | 748 | GNUNET_break_op (0); |
749 | fail_intersection_operation(op); | 749 | fail_intersection_operation(op); |
750 | } | 750 | } |
751 | |||
752 | if (0 == op->state->my_element_count) { | ||
753 | send_peer_done (op); | ||
754 | return; | ||
755 | } | ||
751 | 756 | ||
752 | op->state->phase = PHASE_BF_EXCHANGE; | 757 | op->state->phase = PHASE_BF_EXCHANGE; |
753 | op->state->my_elements = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); | 758 | op->state->my_elements = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); |
@@ -758,7 +763,7 @@ handle_p2p_element_info (void *cls, const struct GNUNET_MessageHeader *mh) | |||
758 | 763 | ||
759 | GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf); | 764 | GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf); |
760 | op->state->remote_bf = NULL; | 765 | op->state->remote_bf = NULL; |
761 | 766 | ||
762 | if (op->state->my_element_count == ntohl (msg->sender_element_count)) | 767 | if (op->state->my_element_count == ntohl (msg->sender_element_count)) |
763 | op->state->phase = PHASE_MAYBE_FINISHED; | 768 | op->state->phase = PHASE_MAYBE_FINISHED; |
764 | 769 | ||