diff options
author | 2019-08-13 16:36:38 -0700 | |
---|---|---|
committer | 2019-08-13 16:36:38 -0700 | |
commit | 47fba7fba0b814246195167df01e745faba68dc6 (patch) | |
tree | 14df99cbf7e65bb0827a12040c017cd7d2776292 /libs/binder/Parcel.cpp | |
parent | e3aff37dc7e02cd2104767dac8f115ec1bfd3cd4 (diff) | |
parent | 40b476c5790168a9bad2d7b5459883c07d25cc35 (diff) |
DO NOT MERGE - Merge pie-platform-release (PPRL.190801.002) into master
Bug: 139369544
Change-Id: I24c88d4bc056d8440d6de94488fb3d7fd6ad5200
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r-- | libs/binder/Parcel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index c75f0365f5..485869e535 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1797,8 +1797,8 @@ status_t Parcel::readUtf8FromUtf16(std::unique_ptr<std::string>* str) const { const char* Parcel::readCString() const { - const size_t avail = mDataSize-mDataPos; - if (avail > 0) { + if (mDataPos < mDataSize) { + const size_t avail = mDataSize-mDataPos; const char* str = reinterpret_cast<const char*>(mData+mDataPos); // is the string's trailing NUL within the parcel's valid bounds? const char* eos = reinterpret_cast<const char*>(memchr(str, 0, avail)); |