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

Commit 277832b3 authored by Steve Kondik's avatar Steve Kondik
Browse files

Merge tag 'android-7.0.0_r6' of...

Merge tag 'android-7.0.0_r6' of https://android.googlesource.com/platform/frameworks/native into cm-14.0

Android 7.0.0 release 6

Change-Id: I7379a40e1f3d34c1a30e04c449821c23455f38db
parents 27034b01 36324792
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1803,15 +1803,16 @@ status_t Parcel::readUtf8FromUtf16(std::string* str) const {
       return NO_ERROR;
    }

    ssize_t utf8Size = utf16_to_utf8_length(src, utf16Size);
    if (utf8Size < 0) {
    // Allow for closing '\0'
    ssize_t utf8Size = utf16_to_utf8_length(src, utf16Size) + 1;
    if (utf8Size < 1) {
        return BAD_VALUE;
    }
    // Note that while it is probably safe to assume string::resize keeps a
    // spare byte around for the trailing null, we're going to be explicit.
    str->resize(utf8Size + 1);
    utf16_to_utf8(src, utf16Size, &((*str)[0]));
    // spare byte around for the trailing null, we still pass the size including the trailing null
    str->resize(utf8Size);
    utf16_to_utf8(src, utf16Size, &((*str)[0]), utf8Size);
    str->resize(utf8Size - 1);
    return NO_ERROR;
}

+5 −0
Original line number Diff line number Diff line
@@ -795,6 +795,11 @@ status_t Region::unflatten(void const* buffer, size_t size) {
        return NO_MEMORY;
    }

    if (numRects > (UINT32_MAX / sizeof(Rect))) {
        android_errorWriteWithInfoLog(0x534e4554, "29983260", -1, NULL, 0);
        return NO_MEMORY;
    }

    Region result;
    result.mStorage.clear();
    for (size_t r = 0; r < numRects; ++r) {