Module: wine Branch: master Commit: 77d2f6ae74c64950734f08e884931d3a924ff13a URL: https://gitlab.winehq.org/wine/wine/-/commit/77d2f6ae74c64950734f08e884931d3...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu Dec 1 19:31:44 2022 +0100
mountmgr.sys: Allocate UNICODE_STRING buffers with RtlAllocateHeap.
---
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);