aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-06-19 12:38:15 -0400
committerNick Mathewson <nickm@torproject.org>2016-06-19 12:38:15 -0400
commit1160ac1283a076acc6c660827ebeb84a111f27cc (patch)
tree1a54214bf09d05c9285445aed38f8238bb0b9d0e
parent58e6a6aaebc32683f041925351d8a8101c86abda (diff)
downloadtor-1160ac1283a076acc6c660827ebeb84a111f27cc.tar.gz
tor-1160ac1283a076acc6c660827ebeb84a111f27cc.zip
Changes file for 19063; use the BUG macro
-rw-r--r--changes/bug190634
-rw-r--r--src/common/util.c2
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) \