Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Goulet
Tor
Commits
04512d9f
Commit
04512d9f
authored
Jul 12, 2018
by
Nick Mathewson
⛰
Browse files
SOCKS: Always free username/password before setting them.
This fixes a memory leak found by fuzzing.
parent
2d0e1cef
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core/proto/proto_socks.c
View file @
04512d9f
...
...
@@ -174,6 +174,7 @@ parse_socks4_request(const uint8_t *raw_data, socks_request_t *req,
goto
end
;
}
tor_free
(
req
->
username
);
req
->
got_auth
=
1
;
req
->
username
=
tor_strdup
(
username
);
req
->
usernamelen
=
usernamelen
;
...
...
@@ -445,6 +446,7 @@ parse_socks5_userpass_auth(const uint8_t *raw_data, socks_request_t *req,
socks5_client_userpass_auth_getconstarray_passwd
(
trunnel_req
);
if
(
usernamelen
&&
username
)
{
tor_free
(
req
->
username
);
req
->
username
=
tor_memdup_nulterm
(
username
,
usernamelen
);
req
->
usernamelen
=
usernamelen
;
...
...
@@ -452,6 +454,7 @@ parse_socks5_userpass_auth(const uint8_t *raw_data, socks_request_t *req,
}
if
(
passwordlen
&&
password
)
{
tor_free
(
req
->
password
);
req
->
password
=
tor_memdup_nulterm
(
password
,
passwordlen
);
req
->
passwordlen
=
passwordlen
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment