diff options
| author | 2020-12-09 00:31:39 +0000 | |
|---|---|---|
| committer | 2020-12-09 00:31:39 +0000 | |
| commit | 082832d91d8ed940b24c7fe85bb4d6f7f66a7672 (patch) | |
| tree | 73b761a57c33ba1ff9f48fc9d1a7be0f11ea7ab4 /libs/binder/Parcel.cpp | |
| parent | 398f3df9ac8874502946e77532a0c279d4266d48 (diff) | |
| parent | 000700590a1c14e3dba970cca7ae36c4cd1605a4 (diff) | |
libbinder: readString*Inplace SafetyNet (II) am: 61d0f84881 am: 000700590a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/13170519
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I8b291b5a15ea36a9cf517bcfba57bfb2b7b17545
Diffstat (limited to 'libs/binder/Parcel.cpp')
| -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 e301400941..64a4f9bf6d 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;  |