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) {