summaryrefslogtreecommitdiff
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2024-03-08 23:43:21 +0000
committer Steven Moreland <smoreland@google.com> 2024-03-08 23:43:21 +0000
commit47d7f1e33892bd7075143e7c66ce33d1c2c16357 (patch)
treece2418afc9112f97d65e62f70d6023d0d1d93ede /libs/binder/Parcel.cpp
parente7feba5da3ab1a9cd8ca1c5cb8b60e68e0ec2f93 (diff)
libbinder: restartWrite abort out of memory
Most code in Android and indeed in libbinder will abort in this case. Since setData is underspecified, we should probably start the process of removing all the users of it (AIDL does not use it). However, until it can be removed, it's safer to abort here than risk mObjects is referenced in an invalid state from here on. Bug: 328177618 Test: N/A Change-Id: Ia36303e1f9bdc91d37943aa106bd832166b91e28
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index c1770b35d1..2a3ab7446a 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -2932,6 +2932,7 @@ status_t Parcel::restartWrite(size_t desired)
uint8_t* data = reallocZeroFree(mData, mDataCapacity, desired, mDeallocZero);
if (!data && desired > mDataCapacity) {
+ LOG_ALWAYS_FATAL("out of memory");
mError = NO_MEMORY;
return NO_MEMORY;
}