From 0f2b4fbcd847ccf3e9e2caef9582081e8f1ffc3b Mon Sep 17 00:00:00 2001 From: shyouhei Date: Sun, 15 Jun 2008 10:19:52 +0000 Subject: merge revision(s) 15482: * ext/iconv/iconv.c (iconv_convert): check upper bound. a patch from Daniel Luz at [ruby-Bugs-17910]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@17175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/iconv/iconv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 918dd51630..484abd203d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -423,8 +423,11 @@ iconv_convert length = 0; else if ((length -= start) < 0) length = 0; - else + else { inptr += start; + if (length > slen) + length = slen; + } } instart = inptr; inlen = length; -- cgit v1.2.3