[PATCH] fixed crash in jscript/run test

Marcus Meissner meissner at suse.de
Sun Sep 28 09:56:50 CDT 2008


Hi,

One codepath in String_replace is where parens_cnt and parens are used
but parens_cnt is not initialized. So initialize it to 0.

Ciao, Marcus
---
 dlls/jscript/string.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c
index fc40462..11ef882 100644
--- a/dlls/jscript/string.c
+++ b/dlls/jscript/string.c
@@ -530,7 +530,7 @@ static HRESULT rep_call(DispatchEx *func, const WCHAR *str, match_result_t *matc
 static HRESULT String_replace(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
         VARIANT *retv, jsexcept_t *ei, IServiceProvider *caller)
 {
-    DWORD parens_cnt, parens_size=0, rep_len=0, length;
+    DWORD parens_cnt = 0, parens_size=0, rep_len=0, length;
     BSTR rep_str = NULL, match_str = NULL, ret_str;
     DispatchEx *rep_func = NULL, *regexp = NULL;
     match_result_t *parens = NULL, match;
-- 
1.5.6



More information about the wine-patches mailing list