Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit feb1399c authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

osi: Prevent memory allocations with MSB set am: 1d83f31b

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/15959601

Change-Id: I3f033ec55080fbb2d924662b20d5e09a89a00c51
parents 2a8202be 1d83f31b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);