mirror of
https://github.com/php/php-src.git
synced 2025-01-15 16:24:37 +08:00
better fix for iconv_substr
This commit is contained in:
parent
c891118ce9
commit
39253a5418
@ -765,10 +765,14 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
|
||||
}
|
||||
}
|
||||
|
||||
if (offset >= total_len || len > total_len) {
|
||||
if(len > total_len) {
|
||||
len = total_len;
|
||||
}
|
||||
|
||||
if (offset >= total_len) {
|
||||
return PHP_ICONV_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
if ((offset + len) > total_len) {
|
||||
/* trying to compute the length */
|
||||
len = total_len - offset;
|
||||
|
Loading…
Reference in New Issue
Block a user