mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
terminate zero-length char array with null char in stringUTFChars
This commit is contained in:
parent
ebd7f69c41
commit
248ff91d74
@ -3667,7 +3667,6 @@ stringUTFChars(Thread* t, object string, unsigned start, unsigned length,
|
|||||||
assert(t, static_cast<unsigned>
|
assert(t, static_cast<unsigned>
|
||||||
(stringUTFLength(t, string, start, length)) == charsLength);
|
(stringUTFLength(t, string, start, length)) == charsLength);
|
||||||
|
|
||||||
if (length) {
|
|
||||||
object data = stringData(t, string);
|
object data = stringData(t, string);
|
||||||
if (objectClass(t, data) == type(t, Machine::ByteArrayType)) {
|
if (objectClass(t, data) == type(t, Machine::ByteArrayType)) {
|
||||||
memcpy(chars,
|
memcpy(chars,
|
||||||
@ -3694,7 +3693,6 @@ stringUTFChars(Thread* t, object string, unsigned start, unsigned length,
|
|||||||
}
|
}
|
||||||
chars[j] = 0;
|
chars[j] = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
|
Loading…
Reference in New Issue
Block a user