diff options
-rw-r--r-- | changes/bug2324 | 4 | ||||
-rw-r--r-- | src/common/util.c | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/changes/bug2324 b/changes/bug2324 new file mode 100644 index 000000000..eefc8370e --- /dev/null +++ b/changes/bug2324 @@ -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. + diff --git a/src/common/util.c b/src/common/util.c index 4e859779b..c7282e733 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -174,6 +174,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 |