diff options
author | 2019-06-12 09:56:19 +0000 | |
---|---|---|
committer | 2019-06-12 09:56:19 +0000 | |
commit | 10308535f891cc57e1cffba1f67266f183a2b579 (patch) | |
tree | db909ff3f2f9144efdcda103e236aa0a49d21faa /libs/binder/Parcel.cpp | |
parent | 2062c5a408eb44ead19b7e2e797e93b5781ae931 (diff) | |
parent | 0038364ef5e07e106ded67ec444158ddb4b02fed (diff) |
Merge cherrypicks of [7995446, 7995447, 7996042, 7996138, 7995448, 7995449, 7995789, 7995790, 7995450, 7996029, 7996030, 7996139, 7996140, 7996141, 7996142, 7996143, 7996144, 7995544, 7995545, 7995546, 7995547, 7995548, 7995549, 7995550, 7996145, 7996146, 7996032, 7996147, 7996148, 7996149, 7996150, 7994747, 7994748, 7995451, 7994749, 7994750, 7995966, 7995967, 7994751, 7996151, 7996152, 7996153] into pi-qpr3-b-release
Change-Id: Ib4908a4a2f5e53932bb32d27ea3411ef6f85224e
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 2e7edd7a28..8e206f501f 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -2013,8 +2013,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)); |