]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Spec conformance on protover: always reject ranges where lo>hi
authorNick Mathewson <nickm@torproject.org>
Thu, 15 Feb 2018 15:49:47 +0000 (10:49 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 1 Mar 2018 21:05:17 +0000 (16:05 -0500)
src/or/protover.c

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