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

Commit ff58d7c9 authored by Sergio Giro's avatar Sergio Giro Committed by android-build-merger
Browse files

Add bound checks to utf16_to_utf8 am: bce11021 am: 00812049

am: bab33342

Change-Id: I6e4e399dfcf89f46d40a162c77462b889883f569
parents cbe258aa bab33342
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,8 +63,8 @@ aaptHostLdLibs :=
aaptHostStaticLibs := \
    libandroidfw \
    libpng \
    liblog \
    libutils \
    liblog \
    libcutils \
    libexpat \
    libziparchive-host \
+3 −1
Original line number Diff line number Diff line
@@ -303,8 +303,10 @@ std::string utf16ToUtf8(const StringPiece16& utf16) {
    }

    std::string utf8;
    // Make room for '\0' explicitly.
    utf8.resize(utf8Length + 1);
    utf16_to_utf8(utf16.data(), utf16.length(), &*utf8.begin(), utf8Length + 1);
    utf8.resize(utf8Length);
    utf16_to_utf8(utf16.data(), utf16.length(), &*utf8.begin());
    return utf8;
}

+1 −1
Original line number Diff line number Diff line
@@ -48,8 +48,8 @@ hostStaticLibs := \
    libaapt \
    libandroidfw \
    libpng \
    liblog \
    libutils \
    liblog \
    libcutils \
    libexpat \
    libziparchive-host \