diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-02-15 10:49:47 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-03-01 16:05:17 -0500 |
commit | c5295cc1beb1c13743e11d3a7134e9e75b6da470 (patch) | |
tree | c9d670ec346c8c3e873841f145e7687400a8e5d4 | |
parent | 1fe0bae508120bbf4954de6b590dd0c722a883bc (diff) | |
download | tor-c5295cc1beb1c13743e11d3a7134e9e75b6da470.tar.gz tor-c5295cc1beb1c13743e11d3a7134e9e75b6da470.zip |
Spec conformance on protover: always reject ranges where lo>hi
-rw-r--r-- | src/or/protover.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/protover.c b/src/or/protover.c index a035b5c83b..0c79037f68 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; |