mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
fix leak and overrun added in e49a477a
This commit is contained in:
parent
cb34fe12d1
commit
697e8d0264
|
@ -1 +1 @@
|
|||
7c43e683316530c0e9c46df4e670465b887f2a0c0774ee1dc67e4b0e1ca20a35 /usr/local/bin/tox-bootstrapd
|
||||
2cf1f9b0e7e294b3fb767970c4cf310abbb3a690424f3483bf359ad5714d6ec7 /usr/local/bin/tox-bootstrapd
|
||||
|
|
|
@ -541,6 +541,7 @@ int dht_create_packet(const Random *rng, const uint8_t public_key[CRYPTO_PUBLIC_
|
|||
}
|
||||
|
||||
if (length < 1 + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE + encrypted_length) {
|
||||
free(encrypted);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1034,7 +1035,7 @@ void set_announce_node(DHT *dht, const uint8_t *public_key)
|
|||
index = LCLIENT_LENGTH - 1;
|
||||
}
|
||||
|
||||
set_announce_node_in_list(dht->close_clientlist + index * LCLIENT_NODES, LCLIENT_LIST, public_key);
|
||||
set_announce_node_in_list(dht->close_clientlist + index * LCLIENT_NODES, LCLIENT_LENGTH, public_key);
|
||||
|
||||
for (int32_t i = 0; i < dht->num_friends; ++i) {
|
||||
set_announce_node_in_list(dht->friends_list[i].client_list, MAX_FRIEND_CLIENTS, public_key);
|
||||
|
|
Loading…
Reference in New Issue
Block a user