Skip to content

Commit 56077b0

Browse files
committed
Return early from mb_strcut if 'len' parameter is zero
1 parent 6f569b4 commit 56077b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mbstring/mbstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,7 @@ PHP_FUNCTION(mb_strcut)
24362436
}
24372437
}
24382438

2439-
if (from > string.len) {
2439+
if (from > string.len || len == 0) {
24402440
RETURN_EMPTY_STRING();
24412441
}
24422442

0 commit comments

Comments
 (0)