Browse Source

Changes file for 19063; use the BUG macro

Nick Mathewson 7 years ago
parent
commit
1160ac1283
2 changed files with 5 additions and 1 deletions
  1. 4 0
      changes/bug19063
  2. 1 1
      src/common/util.c

+ 4 - 0
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.

+ 1 - 1
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)                               \