Commit e09ab697 authored by Nick Mathewson's avatar Nick Mathewson 🐘
Browse files

Check size against SIZE_T_CEILING in realloc too.

Fixes bug 2324.
parent 5c09431c
Loading
Loading
Loading
Loading

changes/bug2324

0 → 100644
+4 −0
Changes for changes/bug2324: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
  o Minor bugfixes
    - Add a check for SIZE_T_MAX to tor_realloc to try to avoid
      underflow errors there too.  Fixes bug 2324.
+2 −0
Changes for src/common/util.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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