mirror of
https://github.com/php/php-src.git
synced 2026-04-01 21:22:13 +02:00
better fix for iconv_substr
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user