[6/6] msi: Avoid accessing uninitialized memory in ACTION_AppSearchReg.

Hans Leidekker hans at codeweavers.com
Tue Oct 27 04:07:50 CDT 2009


Found by valgrind.
---
 dlls/msi/appsearch.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c
index 4ef4087..95daabb 100644
--- a/dlls/msi/appsearch.c
+++ b/dlls/msi/appsearch.c
@@ -445,7 +445,8 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
     if (sz == 0)
         goto end;
 
-    if ((ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"')))
+    if ((regType == REG_SZ || regType == REG_EXPAND_SZ) &&
+        (ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"')))
         *end = '\0';
     else
         ptr = (LPWSTR)value;
-- 
1.6.3.3




More information about the wine-patches mailing list