]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
consdiff: Fix 32-bit compilation.
authorNick Mathewson <nickm@torproject.org>
Thu, 16 Mar 2017 19:14:16 +0000 (15:14 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 16 Mar 2017 19:14:16 +0000 (15:14 -0400)
Thanks, jenkins!

src/or/consdiff.c

index 13b267f4a0116227fdc0108c40703e1dc277ac8d..d2a2af1b5facd01dad7651e6bdbcf7b875a92c41 100644 (file)
@@ -391,7 +391,8 @@ get_id_hash(const cdline_t *line, cdline_t *hash_out)
 
   hash_out->s = hash;
   /* Always true because lines are limited to this length */
-  tor_assert(hash_end - hash <= UINT32_MAX);
+  tor_assert(hash_end >= hash);
+  tor_assert((size_t)(hash_end - hash) <= UINT32_MAX);
   hash_out->len = (uint32_t)(hash_end - hash);
 
   return 0;