commit | 65199f1b253c4bfb225805629217acb8f0b1e185 | [log] [tgz] |
---|---|---|
author | Kostya Serebryany <kcc@google.com> | Fri Jan 25 11:46:22 2013 +0000 |
committer | Kostya Serebryany <kcc@google.com> | Fri Jan 25 11:46:22 2013 +0000 |
tree | 1c5ad5bb27171feeae8df5b1126f835f933f208b | |
parent | 6503100c43c8951f436698b47362cdc8c2ec0a69 [diff] [blame] |
[sanitizer] fix calloc overflow in asan/tsan/msan git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173441 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc index b13a7c6..26baf73 100644 --- a/lib/sanitizer_common/sanitizer_allocator.cc +++ b/lib/sanitizer_common/sanitizer_allocator.cc
@@ -75,4 +75,9 @@ low_level_alloc_callback = callback; } +bool CallocShouldReturnNullDueToOverflow(uptr size, uptr n) { + uptr mul = size * n; + return mul < size || mul < n; +} + } // namespace __sanitizer