]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a SIZE_T_CEILING check in torgzip.c; noticed by cypherpunks
authorNick Mathewson <nickm@torproject.org>
Wed, 5 Jan 2011 17:42:34 +0000 (12:42 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 5 Jan 2011 17:42:34 +0000 (12:42 -0500)
src/common/torgzip.c

index b44b159a463c8c3a3a1c35e71ab12a9c8c85a1e0..76786687776eb74727d4c2de374fbe8c54d1108b 100644 (file)
@@ -247,7 +247,7 @@ tor_gzip_uncompress(char **out, size_t *out_len,
 
   out_size = in_len * 2;  /* guess 50% compression. */
   if (out_size < 1024) out_size = 1024;
-  if (out_size > SIZE_T_CEILING || out_size > UINT_MAX)
+  if (out_size >= SIZE_T_CEILING || out_size > UINT_MAX)
     goto err;
 
   *out = tor_malloc(out_size);