Skip to content

Commit 50677b6

Browse files
committed
Comments
1 parent dd68b4d commit 50677b6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/mbstring/libmbfl/mbfl/mbfilter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ mbfl_strpos(
881881
goto out;
882882
}
883883

884+
/* Bug somewhere in this segment for Out Of Bound detection (normal mode i.e. !reverse with negative offsets) */
884885
if (!reverse) {
885886
size_t jtbl[1 << (sizeof(unsigned char) * 8)];
886887
size_t needle_u8_len = needle_u8->len;
@@ -897,6 +898,7 @@ mbfl_strpos(
897898
e = haystack_u8_val + haystack_u8->len;
898899
p = haystack_u8_val;
899900
while (offset-- > 0) {
901+
/* If positive offset is larger than the number of code points in the string */
900902
if (p >= e) {
901903
result = (size_t) -16;
902904
goto out;

0 commit comments

Comments
 (0)