Skip to content

Commit 3bf4319

Browse files
committed
Don't check for impossible error condition in mb_substr_count
1 parent 8c32deb commit 3bf4319

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ext/mbstring/libmbfl/mbfl/mbfilter.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,7 @@ mbfl_substr_count(
692692
needle->encoding,
693693
&mbfl_encoding_wchar,
694694
mbfl_wchar_device_output, 0, &pc.needle);
695-
if (filter == NULL) {
696-
return MBFL_ERROR_ENCODING;
697-
}
695+
ZEND_ASSERT(filter);
698696
mbfl_convert_filter_feed_string(filter, needle->val, needle->len);
699697
mbfl_convert_filter_flush(filter);
700698
mbfl_convert_filter_delete(filter);
@@ -711,10 +709,7 @@ mbfl_substr_count(
711709
haystack->encoding,
712710
&mbfl_encoding_wchar,
713711
collector_strpos, 0, &pc);
714-
if (filter == NULL) {
715-
mbfl_wchar_device_clear(&pc.needle);
716-
return MBFL_ERROR_ENCODING;
717-
}
712+
ZEND_ASSERT(filter);
718713
pc.start = 0;
719714
pc.output = 0;
720715
pc.needle_pos = 0;

0 commit comments

Comments
 (0)