aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fs/gnunet-service-fs.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index f59f18546..da0e2a28f 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -1581,7 +1581,14 @@ peer_connect_handler (void *cls,
1581 struct MigrationReadyBlock *pos; 1581 struct MigrationReadyBlock *pos;
1582 char *fn; 1582 char *fn;
1583 uint32_t trust; 1583 uint32_t trust;
1584 1584
1585 cp = GNUNET_CONTAINER_multihashmap_get (connected_peers,
1586 &peer->hashPubKey);
1587 if (NULL != cp)
1588 {
1589 GNUNET_break (0);
1590 return;
1591 }
1585 cp = GNUNET_malloc (sizeof (struct ConnectedPeer)); 1592 cp = GNUNET_malloc (sizeof (struct ConnectedPeer));
1586 cp->transmission_delay = GNUNET_LOAD_value_init (latency); 1593 cp->transmission_delay = GNUNET_LOAD_value_init (latency);
1587 cp->pid = GNUNET_PEER_intern (peer); 1594 cp->pid = GNUNET_PEER_intern (peer);
@@ -4018,7 +4025,13 @@ handle_p2p_get (void *cls,
4018 return GNUNET_SYSERR; 4025 return GNUNET_SYSERR;
4019 } 4026 }
4020 opt = (const GNUNET_HashCode*) &gm[1]; 4027 opt = (const GNUNET_HashCode*) &gm[1];
4021 bfsize = msize - sizeof (struct GetMessage) + bits * sizeof (GNUNET_HashCode); 4028 bfsize = msize - sizeof (struct GetMessage) - bits * sizeof (GNUNET_HashCode);
4029 /* bfsize must be power of 2, check! */
4030 if (0 != ( (bfsize - 1) & bfsize))
4031 {
4032 GNUNET_break_op (0);
4033 return GNUNET_SYSERR;
4034 }
4022 bm = ntohl (gm->hash_bitmap); 4035 bm = ntohl (gm->hash_bitmap);
4023 bits = 0; 4036 bits = 0;
4024 cps = GNUNET_CONTAINER_multihashmap_get (connected_peers, 4037 cps = GNUNET_CONTAINER_multihashmap_get (connected_peers,