[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] dirparse: reject votes with malformed routerstatus entries



commit 5d330997f690845fadbd71f71f26a2ea464cd1ab
Author: cypherpunks <cypherpunks@xxxxxxxxxxxxxx>
Date:   Sat Feb 8 20:10:40 2020 +0000

    dirparse: reject votes with malformed routerstatus entries
---
 src/feature/dirparse/ns_parse.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/feature/dirparse/ns_parse.c b/src/feature/dirparse/ns_parse.c
index 109eebeb66..7cb92ebe59 100644
--- a/src/feature/dirparse/ns_parse.c
+++ b/src/feature/dirparse/ns_parse.c
@@ -1432,6 +1432,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
         smartlist_add(ns->routerstatus_list, rs);
       } else {
         vote_routerstatus_free(rs);
+        goto err; // Malformed routerstatus, reject this vote.
       }
     } else {
       routerstatus_t *rs;
@@ -1441,6 +1442,8 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
                                                      flav))) {
         /* Use exponential-backoff scheduling when downloading microdescs */
         smartlist_add(ns->routerstatus_list, rs);
+      } else {
+        goto err; // Malformed routerstatus, reject this vote.
       }
     }
   }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits