Ensure marshaled UTF-8 string arrays are null terminated.

This commit is contained in:
Peter Huene
2020-02-24 18:20:27 -08:00
parent 8dff0fc121
commit 78ee043524

View File

@@ -499,7 +499,7 @@ namespace Wasmtime
for (int i = 0; i < strings.Count; ++i)
{
handles[i] = GCHandle.Alloc(
Encoding.UTF8.GetBytes(strings[i]),
Encoding.UTF8.GetBytes(strings[i] + '\0'),
GCHandleType.Pinned
);
}