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

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



commit c5295cc1beb1c13743e11d3a7134e9e75b6da470
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
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;



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