diff options
author | teor <teor@torproject.org> | 2020-04-14 15:53:17 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2020-04-29 22:43:09 +1000 |
commit | 587a7fbcf62447c7ade05c57220f1bfe2f3acdc1 (patch) | |
tree | 9f945efcdb9a982892c3bbc22ffd7d6bce0dc068 /src/core | |
parent | f6c8a8c5387eaf35470f08e9cd9b35f05bdc1057 (diff) | |
download | tor-587a7fbcf62447c7ade05c57220f1bfe2f3acdc1.tar.gz tor-587a7fbcf62447c7ade05c57220f1bfe2f3acdc1.zip |
core/or: Check extends for zero addresses and ports
Check for invalid zero IPv4 addresses and ports, when sending and
receiving extend cells.
Fixes bug 33900; bugfix on 0.2.4.8-alpha.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/onion.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/or/onion.c b/src/core/or/onion.c index 543d9f3e47..d73f981d2c 100644 --- a/src/core/or/onion.c +++ b/src/core/or/onion.c @@ -244,14 +244,14 @@ check_extend_cell(const extend_cell_t *cell) if (tor_digest_is_zero((const char*)cell->node_id)) return -1; - if (tor_addr_family(&cell->orport_ipv4.addr) == AF_UNSPEC) { + if (!tor_addr_port_is_valid_ap(&cell->orport_ipv4, 0)) { /* EXTEND cells must have an IPv4 address. */ if (!is_extend2) { return -1; } /* EXTEND2 cells must have at least one IP address. * It can be IPv4 or IPv6. */ - if (tor_addr_family(&cell->orport_ipv6.addr) == AF_UNSPEC) { + if (!tor_addr_port_is_valid_ap(&cell->orport_ipv6, 0)) { return -1; } } |