aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-11-02 23:04:48 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-11-02 23:04:48 +0000
commitd47e67715fe072d05a9b362e22a0a56a0d90168a (patch)
tree01d1c57e953587685bbdcdacba79cdd8016d055e
parente7d959bcb936337c8426272cc8f5eff00c05e782 (diff)
parenta304195ea8d5667f2409fb64075ac3ddae2566f6 (diff)
downloadbt-d47e67715fe072d05a9b362e22a0a56a0d90168a.tar.gz
Merge cherrypicks of [15959599] into rvc-platform-release.android-platform-11.0.0_r14android-platform-11.0.0_r13
Change-Id: Iee3631780d9c73eb051fc34faf80720432ac0eaf
-rw-r--r--osi/src/allocator.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/osi/src/allocator.cc b/osi/src/allocator.cc
index 1c0449e14..e2c356dd3 100644
--- a/osi/src/allocator.cc
+++ b/osi/src/allocator.cc
@@ -56,6 +56,7 @@ char* osi_strndup(const char* str, size_t len) {
}
void* osi_malloc(size_t size) {
+ CHECK(static_cast<ssize_t>(size) >= 0);
size_t real_size = allocation_tracker_resize_for_canary(size);
void* ptr = malloc(real_size);
CHECK(ptr);
@@ -63,6 +64,7 @@ void* osi_malloc(size_t size) {
}
void* osi_calloc(size_t size) {
+ CHECK(static_cast<ssize_t>(size) >= 0);
size_t real_size = allocation_tracker_resize_for_canary(size);
void* ptr = calloc(1, real_size);
CHECK(ptr);