diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/iconv/iconv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 2c69068802..52b95e186d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -700,11 +700,11 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval, } } - if (offset >= total_len) { + if (offset >= total_len || len > total_len) { return PHP_ICONV_ERR_SUCCESS; } - if ((offset + len) > total_len) { + if ((offset + len) > total_len ) { /* trying to compute the length */ len = total_len - offset; } |
