diff options
author | Mansour Moufid <mansourmoufid@gmail.com> | 2014-10-19 12:11:53 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-02 11:54:42 -0500 |
commit | 3206dbdce1d055e30d84f9f5dd433c733fee3d8a (patch) | |
tree | 872c3e4297e3b5224001f9f82054bb2373b57194 /src/common | |
parent | aff6fa0b59510471a87a8618ee22327acddf8f86 (diff) | |
download | tor-3206dbdce1d055e30d84f9f5dd433c733fee3d8a.tar.gz tor-3206dbdce1d055e30d84f9f5dd433c733fee3d8a.zip |
Refactor the tor_reallocarray_ overflow check.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c index 929eb5ffb2..6e30c47bf9 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -262,7 +262,7 @@ tor_reallocarray_(void *ptr, size_t sz1, size_t sz2 DMALLOC_PARAMS) { /* XXXX we can make this return 0, but we would need to check all the * reallocarray users. */ - tor_assert(sz2 == 0 || sz1 < SIZE_T_CEILING / sz2); + tor_assert(size_mul_check(sz1, sz2)); return tor_realloc(ptr, (sz1 * sz2) DMALLOC_FN_ARGS); } |