From e85b4c67372900013faa7793db0f7e664d5bca2e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 3 May 2020 12:35:27 +0300 Subject: fixes #2374 (Update libtox to 0.2.12) --- protocols/Tox/libtox/src/toxcore/DHT.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/Tox/libtox/src/toxcore/DHT.c') 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; } -- cgit v1.2.3