]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Check size against SIZE_T_CEILING in realloc too.
authorNick Mathewson <nickm@torproject.org>
Mon, 3 Jan 2011 20:15:27 +0000 (15:15 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 3 Jan 2011 20:15:27 +0000 (15:15 -0500)
Fixes bug 2324.

changes/bug2324 [new file with mode: 0644]
src/common/util.c

diff --git a/changes/bug2324 b/changes/bug2324
new file mode 100644 (file)
index 0000000..eefc837
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes
+    - Add a check for SIZE_T_MAX to tor_realloc to try to avoid
+      underflow errors there too.  Fixes bug 2324.
+
index 2b1430c9f27a00db2c0e7adbcf055c5a9a74ea44..7a24df813308d6a70b50a832bbfeb1187d9e9c7a 100644 (file)
@@ -167,6 +167,8 @@ _tor_realloc(void *ptr, size_t size DMALLOC_PARAMS)
 {
   void *result;
 
+  tor_assert(size < SIZE_T_CEILING);
+
 #ifdef USE_DMALLOC
   result = dmalloc_realloc(file, line, ptr, size, DMALLOC_FUNC_REALLOC, 0);
 #else