diff options
author | Steven Moreland <smoreland@google.com> | 2020-12-09 00:07:25 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-12-09 00:07:25 +0000 |
commit | 000700590a1c14e3dba970cca7ae36c4cd1605a4 (patch) | |
tree | d3b770e16ea01f6fd32316bcd00eb286aede63b1 | |
parent | 776ca0830a9a044d37741e1773af0c8ffeb50dbf (diff) | |
parent | 61d0f84881cfc1bbac513ccd156c56603a48cc90 (diff) | |
download | native-000700590a1c14e3dba970cca7ae36c4cd1605a4.tar.gz |
libbinder: readString*Inplace SafetyNet (II) am: 61d0f84881
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/13170519
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I9a5ec3cd31d7f773ca080e8b5b1d17b34189d8f7
-rw-r--r-- | libs/binder/Parcel.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 7065b707b9..c7a9a77464 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1881,8 +1881,11 @@ const char* Parcel::readString8Inplace(size_t* outLen) const if (size >= 0 && size < INT32_MAX) { *outLen = size; const char* str = (const char*)readInplace(size+1); - if (str != nullptr && str[size] == '\0') { - return str; + if (str != nullptr) { + if (str[size] == '\0') { + return str; + } + android_errorWriteLog(0x534e4554, "172655291"); } } *outLen = 0; @@ -1941,8 +1944,11 @@ const char16_t* Parcel::readString16Inplace(size_t* outLen) const if (size >= 0 && size < INT32_MAX) { *outLen = size; const char16_t* str = (const char16_t*)readInplace((size+1)*sizeof(char16_t)); - if (str != nullptr && str[size] == u'\0') { - return str; + if (str != nullptr) { + if (str[size] == u'\0') { + return str; + } + android_errorWriteLog(0x534e4554, "172655291"); } } *outLen = 0; |