From: Nick Mathewson Date: Thu, 16 Mar 2017 19:14:16 +0000 (-0400) Subject: consdiff: Fix 32-bit compilation. X-Git-Tag: tor-0.3.1.1-alpha~211 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eca9b3424d4cb166ecaa781a8d32f840912a97a1;p=thirdparty%2Ftor.git consdiff: Fix 32-bit compilation. Thanks, jenkins! --- diff --git a/src/or/consdiff.c b/src/or/consdiff.c index 13b267f4a0..d2a2af1b5f 100644 --- a/src/or/consdiff.c +++ b/src/or/consdiff.c @@ -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;