Explorar el Código

Fix a SIZE_T_CEILING check in torgzip.c; noticed by cypherpunks

Nick Mathewson hace 13 años
padre
commit
d14b0d54d2
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/common/torgzip.c

+ 1 - 1
src/common/torgzip.c

@@ -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);