com php-src: Avoid address calculation overflow: ext/standard/string.c
| From: | Nikita Popov | Date: | Thu, 20 Jun 2019 14:22:04 +0000 |
| Subject: | com php-src: Avoid address calculation overflow: ext/standard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106954@lists.php.net to get a copy of this message | ||
Commit: e8ae19223c998fdfe790d368775c5f271e5bdbd9
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 20 Jun 2019 13:06:56 +0200
Parents: e4455c32ed76b74197f1a2647c163d0d470df9fe
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e8ae19223c998fdfe790d368775c5f271e5bdbd9
Log:
Avoid address calculation overflow
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 1fcbe1e..a40a2c3 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2196,7 +2196,7 @@ PHP_FUNCTION(strripos)
php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack
string");
RETURN_FALSE;
}
- e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack) + (size_t)offset;
+ e = ZSTR_VAL(haystack) + (ZSTR_LEN(haystack) + (size_t)offset);
}
/* Borrow that ord_needle buffer to avoid repeatedly tolower()ing needle */
*ZSTR_VAL(ord_needle) = tolower(*ZSTR_VAL(needle));