1
0
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:
Stanislav Malyshev
2007-09-20 21:55:14 +00:00
parent cfd8f6d775
commit c70e307e77
+2 -2
View File
@@ -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;
}