diff options
author | George Hazan <ghazan@miranda.im> | 2020-05-03 12:35:27 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-05-03 12:35:27 +0300 |
commit | e85b4c67372900013faa7793db0f7e664d5bca2e (patch) | |
tree | a30aea519d9c2672ed4a50d32a6ad43acd285497 /protocols/Tox/libtox/src/toxcore/DHT.c | |
parent | cb012794fa0ed74ed57607048dcafc6b06419ba7 (diff) |
fixes #2374 (Update libtox to 0.2.12)
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/DHT.c')
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/DHT.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/DHT.c b/protocols/Tox/libtox/src/toxcore/DHT.c index 191ebc0ed5..b3017259b2 100644 --- a/protocols/Tox/libtox/src/toxcore/DHT.c +++ b/protocols/Tox/libtox/src/toxcore/DHT.c @@ -2721,6 +2721,11 @@ DHT *new_dht(const Logger *log, Mono_Time *mono_time, Networking_Core *net, bool dht->dht_ping_array = ping_array_new(DHT_PING_ARRAY_SIZE, PING_TIMEOUT); dht->dht_harden_ping_array = ping_array_new(DHT_PING_ARRAY_SIZE, PING_TIMEOUT); + if (dht->dht_ping_array == nullptr || dht->dht_harden_ping_array == nullptr) { + kill_dht(dht); + return nullptr; + } + for (uint32_t i = 0; i < DHT_FAKE_FRIEND_NUMBER; ++i) { uint8_t random_public_key_bytes[CRYPTO_PUBLIC_KEY_SIZE]; uint8_t random_secret_key_bytes[CRYPTO_SECRET_KEY_SIZE]; @@ -2924,7 +2929,7 @@ static State_Load_Status dht_load_state_callback(void *outer, const uint8_t *dat } default: - LOGGER_ERROR(dht->log, "Load state (DHT): contains unrecognized part (len %u, type %u)\n", + LOGGER_ERROR(dht->log, "Load state (DHT): contains unrecognized part (len %u, type %u)", length, type); break; } |