mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Check the return value of hs_parse_address().
This patch adds a check for the return value of `hs_parse_address()` in `hs_control_hspost_command()`. Since it should not be possible for `hs_parse_address()` to fail in this context we wrap the error check with the `BUG()` macro. See: https://bugs.torproject.org/24543
This commit is contained in:
parent
01700d779c
commit
9fa38bd996
@ -222,7 +222,9 @@ hs_control_hspost_command(const char *body, const char *onion_address,
|
|||||||
|
|
||||||
/* This can't fail because we require the caller to pass us a valid onion
|
/* This can't fail because we require the caller to pass us a valid onion
|
||||||
* address that has passed hs_address_is_valid(). */
|
* address that has passed hs_address_is_valid(). */
|
||||||
hs_parse_address(onion_address, &identity_pk, NULL, NULL);
|
if (BUG(hs_parse_address(onion_address, &identity_pk, NULL, NULL) < 0)) {
|
||||||
|
goto done; // LCOV_EXCL_LINE
|
||||||
|
}
|
||||||
|
|
||||||
/* Only decode the plaintext part which is what the directory will do to
|
/* Only decode the plaintext part which is what the directory will do to
|
||||||
* validate before caching. */
|
* validate before caching. */
|
||||||
|
Loading…
Reference in New Issue
Block a user