Skip to content

Commit

Permalink
fix leak and overrun added in e49a477
Browse files Browse the repository at this point in the history
  • Loading branch information
zugz committed Apr 7, 2022
1 parent cb34fe1 commit 697e8d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7c43e683316530c0e9c46df4e670465b887f2a0c0774ee1dc67e4b0e1ca20a35 /usr/local/bin/tox-bootstrapd
2cf1f9b0e7e294b3fb767970c4cf310abbb3a690424f3483bf359ad5714d6ec7 /usr/local/bin/tox-bootstrapd
3 changes: 2 additions & 1 deletion toxcore/DHT.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 697e8d0

Please sign in to comment.