Thomas Faber : setupapi: Fix buffer overflow in SetupGetFileCompressionInfoW.
Alexandre Julliard
julliard at winehq.org
Thu Mar 27 14:40:05 CDT 2014
Module: wine
Branch: master
Commit: b8c42020a98e3a5f486cbd03ef80302d6d605871
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b8c42020a98e3a5f486cbd03ef80302d6d605871
Author: Thomas Faber <thomas.faber at reactos.org>
Date: Thu Mar 27 13:54:13 2014 +0100
setupapi: Fix buffer overflow in SetupGetFileCompressionInfoW.
---
dlls/setupapi/misc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/setupapi/misc.c b/dlls/setupapi/misc.c
index 22e55d9..6bdb404 100644
--- a/dlls/setupapi/misc.c
+++ b/dlls/setupapi/misc.c
@@ -1412,7 +1412,8 @@ DWORD WINAPI SetupGetFileCompressionInfoW( PCWSTR source, PWSTR *name, PDWORD so
return ERROR_INVALID_PARAMETER;
ret = SetupGetFileCompressionInfoExW( source, NULL, 0, &required, NULL, NULL, NULL );
- if (!(actual_name = MyMalloc( required ))) return ERROR_NOT_ENOUGH_MEMORY;
+ if (!(actual_name = MyMalloc( required * sizeof(WCHAR) )))
+ return ERROR_NOT_ENOUGH_MEMORY;
ret = SetupGetFileCompressionInfoExW( source, actual_name, required, &required,
source_size, target_size, type );
More information about the wine-cvs
mailing list