summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 1c28c6a49c..ce90848561 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -5739,7 +5739,7 @@ PHP_FUNCTION(substr_compare)
offset = (offset < 0) ? 0 : offset;
}
- if ((size_t)offset >= ZSTR_LEN(s1)) {
+ if ((size_t)offset > ZSTR_LEN(s1)) {
php_error_docref(NULL, E_WARNING, "The start position cannot exceed initial string length");
RETURN_FALSE;
}