Browse Source

Ensure marshaled UTF-8 string arrays are null terminated.

pull/977/head
Peter Huene 5 years ago
parent
commit
78ee043524
No known key found for this signature in database GPG Key ID: E1D265D820213D6A
  1. 2
      crates/misc/dotnet/src/Interop.cs

2
crates/misc/dotnet/src/Interop.cs

@ -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
);
}

Loading…
Cancel
Save