1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2008-08-25 08:35:42 +00:00
parent 0d0c147f23
commit 10906176b4
2 changed files with 5 additions and 2 deletions

View file

@ -1,7 +1,9 @@
Mon Aug 25 17:34:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
Mon Aug 25 17:35:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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) <yugui@yugui.jp>
* parse.y (YYSTYPE): struct RVarmap has been no longer

View file

@ -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;