aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/protover.c7
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;