mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
dotnet: FileSystemHost: zero-init allocations made using Marshal.AllocHGlobal
This commit is contained in:
parent
a4d7aee6f5
commit
81248f3899
@ -1448,6 +1448,9 @@ namespace Fsp
|
||||
_FileSystemInterface.SetEa = SetEa;
|
||||
|
||||
_FileSystemInterfacePtr = Marshal.AllocHGlobal(FileSystemInterface.Size);
|
||||
/* Marshal.AllocHGlobal does not zero memory; we must do it ourselves! */
|
||||
for (int Offset = 0; FileSystemInterface.Size > Offset; Offset += IntPtr.Size)
|
||||
Marshal.WriteIntPtr(_FileSystemInterfacePtr, Offset, IntPtr.Zero);
|
||||
Marshal.StructureToPtr(_FileSystemInterface, _FileSystemInterfacePtr, false);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user