Skip to content

Commit e614fa2

Browse files
authored
Update mbstring.c
1 parent edc593d commit e614fa2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/mbstring/mbstring.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,10 @@ PHP_FUNCTION(mb_str_ends)
27052705
if (needle.len == 0) {
27062706
RETURN_BOOL(1);
27072707
}
2708+
2709+
if (needle.len > haystack.len) {
2710+
RETURN_BOOL(0);
2711+
}
27082712

27092713
n = mbfl_strpos(&haystack, &needle, haystack.len-needle.len, 0);
27102714
if (!mbfl_is_error(n)) {

0 commit comments

Comments
 (0)