From 10906176b4dea0444588fba36b98f4b144a25775 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 25 Aug 2008 08:35:42 +0000 Subject: [PATCH] * transcode.c (rb_econv_substr_append): fix for buffer overrun. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 +++- transcode.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea65fe27a5..56d2bbc782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ -Mon Aug 25 17:34:10 2008 Nobuyoshi Nakada +Mon Aug 25 17:35:23 2008 Nobuyoshi Nakada * transcode.c (rb_econv_substr_append): fix for buffer overrun. + * win32/enc-setup.mak (BUILTIN_TRANSOBJS): added. + Mon Aug 25 14:22:21 2008 Yuki Sonoda (Yugui) * parse.y (YYSTYPE): struct RVarmap has been no longer diff --git a/transcode.c b/transcode.c index 519c2f8c61..ddb185cc77 100644 --- a/transcode.c +++ b/transcode.c @@ -1360,8 +1360,9 @@ rb_econv_substr_append(rb_econv_t *ec, VALUE src, long off, long len, VALUE dst, } ss = sp = (const unsigned char *)RSTRING_PTR(src) + off; se = ss + len; - ds = dp = (unsigned char *)RSTRING_PTR(dst) + dlen; + ds = (unsigned char *)RSTRING_PTR(dst); de = ds + rb_str_capacity(dst); + dp = ds += dlen; res = rb_econv_convert(ec, &sp, se, &dp, de, flags); off += sp - ss; len -= sp - ss;