diff options
Diffstat (limited to 'src/dht/gnunet-service-dht_neighbours.c')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index e4d9ec8ea..68d431d17 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -1610,12 +1610,26 @@ GDS_NEIGHBOURS_handle_reply (struct PeerInfo *pi, | |||
1610 | prm->expiration_time = GNUNET_TIME_absolute_hton (bd->expiration_time); | 1610 | prm->expiration_time = GNUNET_TIME_absolute_hton (bd->expiration_time); |
1611 | prm->key = *query_hash; | 1611 | prm->key = *query_hash; |
1612 | paths = (struct GNUNET_DHT_PathElement *) &prm[1]; | 1612 | paths = (struct GNUNET_DHT_PathElement *) &prm[1]; |
1613 | GNUNET_memcpy (paths, | 1613 | if (NULL != bd->put_path) |
1614 | bd->put_path, | 1614 | { |
1615 | ppl * sizeof(struct GNUNET_DHT_PathElement)); | 1615 | GNUNET_memcpy (paths, |
1616 | GNUNET_memcpy (&paths[ppl], | 1616 | bd->put_path, |
1617 | get_path, | 1617 | ppl * sizeof(struct GNUNET_DHT_PathElement)); |
1618 | get_path_length * sizeof(struct GNUNET_DHT_PathElement)); | 1618 | } |
1619 | else | ||
1620 | { | ||
1621 | GNUNET_assert (0 == ppl); | ||
1622 | } | ||
1623 | if (NULL != get_path) | ||
1624 | { | ||
1625 | GNUNET_memcpy (&paths[ppl], | ||
1626 | get_path, | ||
1627 | get_path_length * sizeof(struct GNUNET_DHT_PathElement)); | ||
1628 | } | ||
1629 | else | ||
1630 | { | ||
1631 | GNUNET_assert (0 == get_path_length); | ||
1632 | } | ||
1619 | /* 0 == get_path_length means path is not being tracked */ | 1633 | /* 0 == get_path_length means path is not being tracked */ |
1620 | if (0 != get_path_length) | 1634 | if (0 != get_path_length) |
1621 | { | 1635 | { |