mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
handle zero length arrays properly in JNIEnv::NewString
This commit is contained in:
parent
2a15201b18
commit
ab5ec510bf
@ -241,9 +241,8 @@ newString(Thread* t, uintptr_t* arguments)
|
||||
const jchar* chars = reinterpret_cast<const jchar*>(arguments[0]);
|
||||
jsize size = arguments[1];
|
||||
|
||||
object a = 0;
|
||||
object a = makeCharArray(t, size);
|
||||
if (size) {
|
||||
a = makeCharArray(t, size);
|
||||
memcpy(&charArrayBody(t, a, 0), chars, size * sizeof(jchar));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user