[tor-commits] [tor/master] Bail out of format_networkstatus_vote if fmt_addr32() failed.
nickm at torproject.org
nickm at torproject.org
Fri Jun 5 14:08:41 UTC 2020
commit ded99992b831bfff782a3b3c612297a4634d3d88
Author: rl1987 <rl1987 at sdf.lonestar.org>
Date: Wed Apr 8 20:01:21 2020 +0300
Bail out of format_networkstatus_vote if fmt_addr32() failed.
Something is fishy if we cannot put IP address string into dir-vote line.
---
src/feature/dirauth/dirvote.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index c8b4637e6..0a9ade132 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -372,6 +372,9 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
tor_free(bw_headers_line);
tor_free(bw_file_digest);
+ if (ip_str[0] == '\0')
+ goto err;
+
if (!tor_digest_is_zero(voter->legacy_id_digest)) {
char fpbuf[HEX_DIGEST_LEN+1];
base16_encode(fpbuf, sizeof(fpbuf), voter->legacy_id_digest, DIGEST_LEN);
More information about the tor-commits
mailing list