diff options
-rw-r--r-- | changes/bug19063 | 4 | ||||
-rw-r--r-- | src/common/util.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/changes/bug19063 b/changes/bug19063 new file mode 100644 index 0000000000..10020098bc --- /dev/null +++ b/changes/bug19063 @@ -0,0 +1,4 @@ + o Minor features (code safety): + - In our integer-parsing functions, check that the maxiumum + value given is no smaller than the minimum value. Closes ticket + 19063; patch from U+039b. diff --git a/src/common/util.c b/src/common/util.c index 97a7e72763..4b6df81b7d 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1112,7 +1112,7 @@ tor_digest256_is_zero(const char *digest) if (!next && *endptr) \ goto err; \ /* Illogical (max, min) inputs? */ \ - if (max < min) \ + if (BUG(max < min)) \ goto err; \ /* Is r within limits? */ \ if (r < min || r > max) \ |