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

Commit 9e18f6a9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "osi: Prevent memory allocations with MSB set"

parents 0041ef49 356f12c9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,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);
@@ -64,6 +65,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);