瀏覽代碼

consdiff: Fix 32-bit compilation.

Thanks, jenkins!
Nick Mathewson 7 年之前
父節點
當前提交
eca9b3424d
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/or/consdiff.c

+ 2 - 1
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;