Skip to content

Commit 4b4f8a0

Browse files
committed
Fix overflow (maybe)
1 parent 4d8aa99 commit 4b4f8a0

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
@@ -3244,7 +3244,7 @@ PHP_FUNCTION(mb_levenshtein)
32443244
}
32453245
if (tmp_wchar_len_2 == 0) {
32463246
/* Insertion process when there is a surplus of 128 code points. */
3247-
for (i2 = 0; i2 < tmp_wchar_len_1; i2++) {
3247+
for (i2 = 0; i2 < tmp_wchar_len_1 && len_2 != 0; i2++) {
32483248
/* for overflow */
32493249
if (len_2 < tmp_wchar_len_1) {
32503250
c0 = p1[i2] + cost_rep;

0 commit comments

Comments
 (0)