mirror of
https://github.com/php/php-src.git
synced 2026-04-26 17:38:14 +02:00
MFB: Fixed bug #37394 (substr_compare() returns an error when offset equals
string length).
This commit is contained in:
@@ -6824,7 +6824,7 @@ PHP_FUNCTION(substr_compare)
|
||||
offset = (offset < 0) ? 0 : offset;
|
||||
}
|
||||
|
||||
if ((offset + len) >= s1_len) {
|
||||
if ((offset + len) > s1_len) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user