[1/2] msi: Avoid an out of bounds access in msi_build_directory_name.

Hans Leidekker hans at codeweavers.com
Wed Aug 1 04:54:18 CDT 2012


---
 dlls/msi/action.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 1ad3bc2..e1d2f2a 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -2154,7 +2154,7 @@ WCHAR *msi_build_directory_name( DWORD count, ... )
         const WCHAR *str = va_arg( va, const WCHAR * );
         if (!str) continue;
         strcatW( dir, str );
-        if ( i + 1 != count && dir[strlenW( dir ) - 1] != '\\') strcatW( dir, szBackSlash );
+        if ( i + 1 != count && dir[0] && dir[strlenW( dir ) - 1] != '\\') strcatW( dir, szBackSlash );
     }
     va_end( va );
     return dir;
-- 
1.7.10.4







More information about the wine-patches mailing list