]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bail out of format_networkstatus_vote if fmt_addr32() failed.
authorrl1987 <rl1987@sdf.lonestar.org>
Wed, 8 Apr 2020 17:01:21 +0000 (20:01 +0300)
committerrl1987 <rl1987@users.noreply.github.com>
Thu, 21 May 2020 10:43:45 +0000 (13:43 +0300)
Something is fishy if we cannot put IP address string into dir-vote line.

src/feature/dirauth/dirvote.c

index c8b4637e666b124bfffcc5b945835d355e496c07..0a9ade13212c8f004ce505856c189119a0bb6e47 100644 (file)
@@ -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);