diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/standard/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 4f2897ce53..e12d5d6a0f 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4884,7 +4884,7 @@ PHP_FUNCTION(substr_compare) RETURN_FALSE; } - if (len && offset >= 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; } |
