From e2fc1ddb537b270bf668bb33b4a067c2ce102b17 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Tue, 7 Nov 2017 19:55:51 +0100 Subject: [PATCH] Fix incorrect size of resulting string in fromUtf8Array() (#1011) --- runtime/src/main/cpp/KString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/main/cpp/KString.cpp b/runtime/src/main/cpp/KString.cpp index f2491826c58..79d90bf823d 100644 --- a/runtime/src/main/cpp/KString.cpp +++ b/runtime/src/main/cpp/KString.cpp @@ -728,7 +728,7 @@ OBJ_GETTER(Kotlin_String_fromUtf8Array, KConstRef thiz, KInt start, KInt size) { } const char* rawString = reinterpret_cast(ByteArrayAddressOfElementAt(array, start)); - RETURN_RESULT_OF(utf8ToUtf16, rawString, array->count_); + RETURN_RESULT_OF(utf8ToUtf16, rawString, size); } OBJ_GETTER(Kotlin_String_toUtf8Array, KString thiz, KInt start, KInt size) {