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

Commit 57af935f authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "libdebuggerd: fix out of bounds write." am: eb1b202a

am: 3c9ed98f

Change-Id: If871552e36aa203ff431e9395d565bf6783b9b16
parents 15045aa7 3c9ed98f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -247,14 +247,13 @@ static void dump_abort_message(log_t* log, Memory* process_memory, uint64_t addr

  length -= sizeof(size_t);

  std::vector<char> msg(length);
  // The abort message should be null terminated already, but reserve a spot for NUL just in case.
  std::vector<char> msg(length + 1);
  if (!process_memory->ReadFully(address + sizeof(length), &msg[0], length)) {
    _LOG(log, logtype::HEADER, "Failed to read abort message: %s\n", strerror(errno));
    return;
  }

  // The abort message should be null terminated already, but just in case...
  msg[length] = '\0';
  _LOG(log, logtype::HEADER, "Abort message: '%s'\n", &msg[0]);
}