[tor-commits] [tor/master] Spec conformance on protover: always reject ranges where lo>hi

nickm at torproject.org nickm at torproject.org
Sat Mar 3 13:17:12 UTC 2018


commit c5295cc1beb1c13743e11d3a7134e9e75b6da470
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Feb 15 10:49:47 2018 -0500

    Spec conformance on protover: always reject ranges where lo>hi
---
 src/or/protover.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/or/protover.c b/src/or/protover.c
index a035b5c83..0c79037f6 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -158,6 +158,9 @@ parse_version_range(const char *s, const char *end_of_range,
   if (next != end_of_range)
     goto error;
 
+  if (low > high)
+    goto error;
+
  done:
   *high_out = high;
   *low_out = low;
@@ -208,10 +211,6 @@ parse_single_entry(const char *s, const char *end_of_entry)
       goto error;
     }
 
-    if (range->low > range->high) {
-      goto error;
-    }
-
     s = comma;
     while (*s == ',' && s < end_of_entry)
       ++s;





More information about the tor-commits mailing list