summaryrefslogtreecommitdiff
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2024-11-20 22:56:20 +0000
committer Steven Moreland <smoreland@google.com> 2024-11-22 23:49:50 +0000
commit75885d9f92d19a2d7778a33f19a0c15fd5e13d14 (patch)
tree0066c89622c5083217b9f1376bd9d0cfa766d052 /libs/binder/Parcel.cpp
parent6acbf87a229e00e7e48eef4daa045ce85f2f6c33 (diff)
readCString: implemented with readInplace
All read logic must go through and be validated in the same few places. Bug: 376674798 Test: binderClearBufTest covers this, and in presubmit Change-Id: Icc0ade84b671ecd3026069d8f672ff254d58e995
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 96d821e196..a5f416f1ba 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -2223,9 +2223,7 @@ const char* Parcel::readCString() const
const char* eos = reinterpret_cast<const char*>(memchr(str, 0, avail));
if (eos) {
const size_t len = eos - str;
- mDataPos += pad_size(len+1);
- ALOGV("readCString Setting data pos of %p to %zu", this, mDataPos);
- return str;
+ return static_cast<const char*>(readInplace(len + 1));
}
}
return nullptr;