Andrew Nguyen : setupapi: Allocate the proper number of bytes for the drive spec.
Module: wine Branch: master Commit: a91fd8fbb2e1f6980a259aad8217a5de363459ec URL: http://source.winehq.org/git/wine.git/?a=commit;h=a91fd8fbb2e1f6980a259aad82... Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Sat Jan 15 02:28:30 2011 -0600 setupapi: Allocate the proper number of bytes for the drive spec. Spotted with Valgrind. --- dlls/setupapi/diskspace.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/setupapi/diskspace.c b/dlls/setupapi/diskspace.c index 89cac07..0a1a5ff 100644 --- a/dlls/setupapi/diskspace.c +++ b/dlls/setupapi/diskspace.c @@ -177,7 +177,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveW(HDSKSPC DiskSpace, return FALSE; } - driveW = HeapAlloc(GetProcessHeap(), 0, lstrlenW(DriveSpec) + 2); + driveW = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(DriveSpec) + 2) * sizeof(WCHAR)); if (!driveW) { SetLastError(ERROR_NOT_ENOUGH_MEMORY);
participants (1)
-
Alexandre Julliard