diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-10 11:34:49 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-10 11:34:49 +0000 |
commit | 3f1d462dac5ca4124c2a67f2c84a6685507b1026 (patch) | |
tree | d4019ff7f87effb989ae9b2bd85f03e398af853a /src | |
parent | 8f6f7a0a4a0389b5e385327f9e4ccca677186216 (diff) | |
download | gnunet-3f1d462dac5ca4124c2a67f2c84a6685507b1026.tar.gz gnunet-3f1d462dac5ca4124c2a67f2c84a6685507b1026.zip |
fix #3664: during PS_RECONNECT_ATS, primary address may be NULL, causing an NPE if we continue here
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index a35100058..9316169a1 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -2819,7 +2819,8 @@ send_utilization_data (void *cls, | |||
2819 | uint32_t bps_out; | 2819 | uint32_t bps_out; |
2820 | struct GNUNET_TIME_Relative delta; | 2820 | struct GNUNET_TIME_Relative delta; |
2821 | 2821 | ||
2822 | if (GNUNET_YES != test_connected (n)) | 2822 | if ( (GNUNET_YES != test_connected (n)) || |
2823 | (NULL == n->primary_address.address) ) | ||
2823 | return GNUNET_OK; | 2824 | return GNUNET_OK; |
2824 | delta = GNUNET_TIME_absolute_get_difference (n->last_util_transmission, | 2825 | delta = GNUNET_TIME_absolute_get_difference (n->last_util_transmission, |
2825 | GNUNET_TIME_absolute_get ()); | 2826 | GNUNET_TIME_absolute_get ()); |
@@ -2830,7 +2831,6 @@ send_utilization_data (void *cls, | |||
2830 | if ((0 != n->util_total_bytes_sent) && (0 != delta.rel_value_us)) | 2831 | if ((0 != n->util_total_bytes_sent) && (0 != delta.rel_value_us)) |
2831 | bps_out = (1000LL * 1000LL * n->util_total_bytes_sent) / delta.rel_value_us; | 2832 | bps_out = (1000LL * 1000LL * n->util_total_bytes_sent) / delta.rel_value_us; |
2832 | 2833 | ||
2833 | |||
2834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2835 | "`%s' total: received %u Bytes/s, sent %u Bytes/s\n", | 2835 | "`%s' total: received %u Bytes/s, sent %u Bytes/s\n", |
2836 | GNUNET_i2s (key), | 2836 | GNUNET_i2s (key), |