Frédéric Delanoy : jscript: Don' t copy more than needed in parse_string_literal.

Alexandre Julliard julliard at winehq.org
Tue Aug 23 12:45:05 CDT 2011


Module: wine
Branch: master
Commit: 69afb0985dd8cb877326fea613adcdc83c9906bb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=69afb0985dd8cb877326fea613adcdc83c9906bb

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Tue Aug 23 11:57:50 2011 +0200

jscript: Don't copy more than needed in parse_string_literal.

---

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

diff --git a/dlls/jscript/lex.c b/dlls/jscript/lex.c
index 157be5b..dcdb3f3 100644
--- a/dlls/jscript/lex.c
+++ b/dlls/jscript/lex.c
@@ -361,7 +361,7 @@ static int parse_string_literal(parser_ctx_t *ctx, const WCHAR **ret, WCHAR endc
     len = ctx->ptr-ptr;
 
     *ret = wstr = parser_alloc(ctx, (len+1)*sizeof(WCHAR));
-    memcpy(wstr, ptr, (len+1)*sizeof(WCHAR));
+    memcpy(wstr, ptr, len*sizeof(WCHAR));
     wstr[len] = 0;
 
     ctx->ptr++;




More information about the wine-cvs mailing list