Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c838b5dd authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

[automerger] libbinder: readCString: no ubsan sub-overflow am: d0d4b584 am:...

[automerger] libbinder: readCString: no ubsan sub-overflow am: d0d4b584 am: a7134ad5 am: 7e71b6ee am: 2537a8b5 am: 85c1e415 am: 6658f2fa am: a9d88cd6 am: 9d5523b8
am: cf43794b

Change-Id: I5ba55922ba967585ce49efee432755d004de46d9
parents 46ee2bb4 cf43794b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -2086,8 +2086,8 @@ status_t Parcel::readUtf8FromUtf16(std::unique_ptr<std::string>* str) const {


const char* Parcel::readCString() const
const char* Parcel::readCString() const
{
{
    if (mDataPos < mDataSize) {
        const size_t avail = mDataSize-mDataPos;
        const size_t avail = mDataSize-mDataPos;
    if (avail > 0) {
        const char* str = reinterpret_cast<const char*>(mData+mDataPos);
        const char* str = reinterpret_cast<const char*>(mData+mDataPos);
        // is the string's trailing NUL within the parcel's valid bounds?
        // is the string's trailing NUL within the parcel's valid bounds?
        const char* eos = reinterpret_cast<const char*>(memchr(str, 0, avail));
        const char* eos = reinterpret_cast<const char*>(memchr(str, 0, avail));