Skip to content

Commit df0e11c

Browse files
wkhudgins92Will Hudgins
authored andcommitted
Update mbstring.c
1 parent 6ce0ac1 commit df0e11c

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
@@ -2713,6 +2713,10 @@ PHP_FUNCTION(mb_str_ends)
27132713
if (needle.len == 0) {
27142714
RETURN_BOOL(1);
27152715
}
2716+
2717+
if (needle.len > haystack.len) {
2718+
RETURN_BOOL(0);
2719+
}
27162720

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

0 commit comments

Comments
 (0)