mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Clear socks auth fields before free
This commit is contained in:
parent
e511a3a4dd
commit
413574ad38
3 changed files with 24 additions and 6 deletions
|
@ -1532,8 +1532,14 @@ socks_request_free(socks_request_t *req)
|
||||||
{
|
{
|
||||||
if (!req)
|
if (!req)
|
||||||
return;
|
return;
|
||||||
tor_free(req->username);
|
if (req->username) {
|
||||||
tor_free(req->password);
|
memset(req->username, 0x10, req->usernamelen);
|
||||||
|
tor_free(req->username);
|
||||||
|
}
|
||||||
|
if (req->password) {
|
||||||
|
memset(req->password, 0x04, req->passwordlen);
|
||||||
|
tor_free(req->password);
|
||||||
|
}
|
||||||
memset(req, 0xCC, sizeof(socks_request_t));
|
memset(req, 0xCC, sizeof(socks_request_t));
|
||||||
tor_free(req);
|
tor_free(req);
|
||||||
}
|
}
|
||||||
|
|
|
@ -552,8 +552,14 @@ circuit_free(circuit_t *circ)
|
||||||
rend_data_free(ocirc->rend_data);
|
rend_data_free(ocirc->rend_data);
|
||||||
|
|
||||||
tor_free(ocirc->dest_address);
|
tor_free(ocirc->dest_address);
|
||||||
tor_free(ocirc->socks_username);
|
if (ocirc->socks_username) {
|
||||||
tor_free(ocirc->socks_password);
|
memset(ocirc->socks_username, 0x12, ocirc->socks_username_len);
|
||||||
|
tor_free(ocirc->socks_username);
|
||||||
|
}
|
||||||
|
if (ocirc->socks_password) {
|
||||||
|
memset(ocirc->socks_password, 0x06, ocirc->socks_password_len);
|
||||||
|
tor_free(ocirc->socks_password);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
or_circuit_t *ocirc = TO_OR_CIRCUIT(circ);
|
or_circuit_t *ocirc = TO_OR_CIRCUIT(circ);
|
||||||
/* Remember cell statistics for this circuit before deallocating. */
|
/* Remember cell statistics for this circuit before deallocating. */
|
||||||
|
|
|
@ -3569,8 +3569,14 @@ circuit_clear_isolation(origin_circuit_t *circ)
|
||||||
tor_free(circ->dest_address);
|
tor_free(circ->dest_address);
|
||||||
circ->session_group = -1;
|
circ->session_group = -1;
|
||||||
circ->nym_epoch = 0;
|
circ->nym_epoch = 0;
|
||||||
tor_free(circ->socks_username);
|
if (circ->socks_username) {
|
||||||
tor_free(circ->socks_password);
|
memset(circ->socks_username, 0x11, circ->socks_username_len);
|
||||||
|
tor_free(circ->socks_username);
|
||||||
|
}
|
||||||
|
if (circ->socks_password) {
|
||||||
|
memset(circ->socks_password, 0x05, circ->socks_password_len);
|
||||||
|
tor_free(circ->socks_password);
|
||||||
|
}
|
||||||
circ->socks_username_len = circ->socks_password_len = 0;
|
circ->socks_username_len = circ->socks_password_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue