[PATCH] msi: check for return value of GetUserName (Coverity)
Marcus Meissner
meissner at suse.de
Wed Sep 7 08:48:23 CDT 2011
Hi,
while this call cannot fail in the current advapi32 implementation,
just check for the return value. CID 5132
Ciao, Marcus
---
dlls/msi/package.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index 1025607..bec7627 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -501,7 +501,8 @@ static UINT set_user_sid_prop( MSIPACKAGE *package )
UINT r = ERROR_FUNCTION_FAILED;
size = 0;
- GetUserNameW( NULL, &size );
+ if (!GetUserNameW( NULL, &size ))
+ return r;
user_name = msi_alloc( (size + 1) * sizeof(WCHAR) );
if (!user_name)
--
1.7.1
More information about the wine-patches
mailing list