mirror of
https://github.com/php/php-src.git
synced 2026-04-24 00:18:23 +02:00
fix potential overflow (Mattias Bengtsson)
This commit is contained in:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user