diff options
Diffstat (limited to 'ext')
-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 f268c7dcc5..fe02df1ce7 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; |