summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt2/util/Util.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/aapt2/util/Util.cpp b/tools/aapt2/util/Util.cpp
index 3c0e9bdeab0d..e743247be8a9 100644
--- a/tools/aapt2/util/Util.cpp
+++ b/tools/aapt2/util/Util.cpp
@@ -434,7 +434,11 @@ std::u16string utf8ToUtf16(const StringPiece& utf8) {
std::u16string utf16;
utf16.resize(utf16Length);
- utf8_to_utf16(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length(), &*utf16.begin());
+ utf8_to_utf16(
+ reinterpret_cast<const uint8_t*>(utf8.data()),
+ utf8.length(),
+ &*utf16.begin(),
+ (size_t) utf16Length + 1);
return utf16;
}