[PATCH 0/1] MR1641: mountmgr.sys: Allocate UNICODE_STRING buffers with RtlAllocateHeap.
From: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/mountmgr.sys/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index c95faa172f7..22c17025e87 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -631,7 +631,7 @@ static NTSTATUS create_disk_device( enum device_type type, struct disk_device ** } name.MaximumLength = (lstrlenW(format) + 10) * sizeof(WCHAR); - name.Buffer = malloc( name.MaximumLength ); + name.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, name.MaximumLength ); for (i = first; i < 32; i++) { swprintf( name.Buffer, name.MaximumLength / sizeof(WCHAR), format, i ); @@ -655,7 +655,7 @@ static NTSTATUS create_disk_device( enum device_type type, struct disk_device ** UNICODE_STRING symlink; symlink.MaximumLength = (lstrlenW(link_format) + 10) * sizeof(WCHAR); - if ((symlink.Buffer = malloc( symlink.MaximumLength ))) + if ((symlink.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, symlink.MaximumLength ))) { swprintf( symlink.Buffer, symlink.MaximumLength / sizeof(WCHAR), link_format, i ); symlink.Length = lstrlenW(symlink.Buffer) * sizeof(WCHAR); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1641
participants (1)
-
Rémi Bernon