diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:20:39 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 10:20:39 +0000 |
commit | 4cff5e63b9556d60cdf62f78b92bcb51024bb7a4 (patch) | |
tree | 6d2d0a12954fc3be2d227226b63319bfd66e7245 /ext/iconv | |
parent | 356a958154e08b232468ab90e6a852e861a0396c (diff) |
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_6@17177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/iconv')
-rw-r--r-- | ext/iconv/iconv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 65fed33bd2..4f5d49e5ed 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; |