mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Improved length parameter validation
This commit is contained in:
parent
42ff70ede8
commit
8696c9bc89
@ -4655,7 +4655,7 @@ PHP_FUNCTION(substr_count)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length should be greater than 0.");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if ((p + Z_LVAL_PP(length)) > endp) {
|
||||
if ((p + Z_LVAL_PP(length)) <= p || (p + Z_LVAL_PP(length)) > endp) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length value %ld exceeds string length.", Z_LVAL_PP(length));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user